Page 1 of 1
Adding records to a many to many relationship
Posted:
Fri Jan 16, 2009 4:33 am
by Grahams
Hi
Just starting out with Xataface and am having some issues with many to many relationships.
I have defined the relationship and Xataface correctly displays the the related records.
However, when I attempt to add a new record to the realtionship, or add an existing record to the realtionship, no records are created.
Straightforward record creation is working fine
Am now struggling to figure out what is wrong as I have followed the Relationships guide in the getting started docs
Thanks
Graham
Posted:
Fri Jan 16, 2009 10:53 am
by shannah
What is the relationship definition (from the relationships.ini file)?
Posted:
Fri Jan 16, 2009 11:42 am
by Grahams
Hi
it is
[Property in Title]
property.ID = titleproperty.PropID
titleproperty.TitleNo = "$TitleNo"
Cheers
Posted:
Fri Jan 16, 2009 11:52 am
by shannah
Try removing the spaces from the relationship name. E.g.
- Code: Select all
[Property_in_Title]
action:label=Property in Title
property.ID = titleproperty.PropID
titleproperty.TitleNo = "$TitleNo"
Note the use of the action:label directive to specify a label without spaces. If this fails, I'll need yet more information about your current set up. E.g. relevant table definitions (SQL).
-Steve
Posted:
Fri Jan 16, 2009 11:53 am
by shannah
Also, when you try to add items, do you get an error message at all? Does anything get inserted into the database at all? If so are some key fields not getting populated?
-Steve
Posted:
Fri Jan 16, 2009 11:58 am
by Grahams
Hi
No errors are thrown, and nothing goes into the database at all, in any table
Also, if I try and add a join to an exisitng record it fails, with no errors
Thanks
Posted:
Fri Jan 16, 2009 12:03 pm
by Grahams
sorry, only just noticed your other post, will try that and update you
Posted:
Fri Jan 16, 2009 12:09 pm
by Grahams
Sorted!!
Thanks for the speedy responses
It was the spaces causing the trouble
Cheers for your help on this
Posted:
Fri Jan 16, 2009 12:15 pm
by shannah
Thanks for pointing this out. I'll add this to the issue tracker so that future versions will scream loudly and give an appropriate error message in this case.
-Steve
Posted:
Fri Jan 16, 2009 12:23 pm
by Grahams
No problem, just started using dataface this week and is much easier for putting a front end on mysql than Dreamweaver - keep up the good work!
Thanks
Graham