Page 1 of 1

Relationships and sql query

PostPosted: Tue Jul 13, 2010 9:03 am
by grageot
Hello
Thanks for this application more simple than others tested.
I have a problem with an SQL query in relationships.ini : one to many relations between a table source "donateurs" (id is the primary key) and "tra nsac10" the destination table
1st problem
first I tried :
Code: Select all
[Dons en 2010]
__sql__ = "SELECT * FROM `transac10` WHERE id = '$id'"

It works well : all the fields of "transac10" appears in the tab

When I use :
Code: Select all
[Dons en 2010]
__sql__ = "SELECT `MontantDon10` , `DateDon10` , `InfoDon10` FROM `transac10` WHERE id = '$id'"

I want only the 3 fields of the table "transac10" BUT all the fields appear in the tab like in the former query

2nd Problem
When i used the "add a new record in transac10" the edit tab is opened but the result is never saved in the base (controlled with PhpMyAdmin)
Where is the misfit ?
Ragards
Guy

Re: Relationships and sql query

PostPosted: Tue Jul 13, 2010 10:30 am
by shannah
Names for relationships cannot contain spaces. If you want you can customize the label of the relationship to have spaces.
See http://xataface.com/wiki/relationships.ini_file for relationships.ini file directives.

Re: Relationships and sql query (solved)

PostPosted: Tue Jul 13, 2010 12:04 pm
by grageot
Thank you for this quick and efficient answer : relationships works correctly