This post has been edited by whizzell: 21 September 2008 - 01:16 PM
help with sql/php syntaxi am trying to get one recordset to be dependant on the other.
Page 1 of 1
2 Replies - 442 Views - Last Post: 23 September 2008 - 06:29 PM
#1
help with sql/php syntax
Posted 21 September 2008 - 12:30 PM
Delete this topic. solved it myself.
Replies To: help with sql/php syntax
#2
Re: help with sql/php syntax
Posted 21 September 2008 - 12:50 PM
And I assume you have a field called something like "chosen_disp_id" in the display settings? That way you can link the type of display settings based on the type of chosen display they set right?
This assumes the relationship would be that you have displays 1, 2, 3 and then settings 1, 2, 3 for display 1, settings 4, 5, 6 for display 2, settings 7, 8, 9 for display 3 etc. As in, the type of display chosen will dictate the type of settings pulled out of the display settings table.
You would do this through a link through the chosen_disp_id field which is the primary key of one table and will be the foreign key in the display settings table.
Here you would fill in the blank with the type of display the user has chosen (like 1, 2, or 3). This would create one to many relationship where one display chosen will pull all settings from the setting table where its chosen_disp_id matches the chosen display value provided by the user.
Hope that is what you are getting at. If not, you need to clarify because the code you have given has little to do with any kind of relationship between the two tables in the database.
This assumes the relationship would be that you have displays 1, 2, 3 and then settings 1, 2, 3 for display 1, settings 4, 5, 6 for display 2, settings 7, 8, 9 for display 3 etc. As in, the type of display chosen will dictate the type of settings pulled out of the display settings table.
You would do this through a link through the chosen_disp_id field which is the primary key of one table and will be the foreign key in the display settings table.
select display_settings.* from display_settings, chosen_displays where chosen_displays.chosen_disp_id = display_settings.chosen_disp_id where chosen_displays.chosen_disp_id = _______
Here you would fill in the blank with the type of display the user has chosen (like 1, 2, or 3). This would create one to many relationship where one display chosen will pull all settings from the setting table where its chosen_disp_id matches the chosen display value provided by the user.
Hope that is what you are getting at. If not, you need to clarify because the code you have given has little to do with any kind of relationship between the two tables in the database.
This post has been edited by Martyr2: 21 September 2008 - 12:51 PM
#3
Re: help with sql/php syntax
Posted 23 September 2008 - 06:29 PM
Even though you have solved this yourself, you should still leave the post for others to find helpful. As well as providing the solution that you found, rather than just trashing your post.
Either way, glad you got it working!
Either way, glad you got it working!
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|