help with sql/php syntax

i am trying to get one recordset to be dependant on the other.

Page 1 of 1

2 Replies - 476 Views - Last Post: 23 September 2008 - 06:29 PM Rate Topic: -----

#1 whizzell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 31-July 08

help with sql/php syntax

Posted 21 September 2008 - 12:30 PM

Delete this topic. solved it myself.

This post has been edited by whizzell: 21 September 2008 - 01:16 PM

Is This A Good Question/Topic? 0
  • +

Replies To: help with sql/php syntax

#2 Martyr2  Icon User is online

  • Programming Theoretician
  • member icon

Reputation: 4421
  • View blog
  • Posts: 12,286
  • Joined: 18-April 07

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.

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

Was This Post Helpful? 1
  • +
  • -

#3 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5388
  • View blog
  • Posts: 27,383
  • Joined: 10-May 07

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!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1