Static42
05-17-2008, 11:14 AM
Hello,
I'm currently converting a lot of my website into PHP/SQL. Right now I'm adding a bunch of the data into a database, but I'm having trouble with how I should pull the data and display it on the page.
I have a table that has TV show episodes data. In one column is the number and the other column has the name. In another table I have a column that has an ID and the other is a number. That number in the second column will relate to the number in the TV show episodes. Here's a diagram that shows what I'm talking about:
http://img.photobucket.com/albums/v91/SableyeRULES/diagram.png
So what should be displayed on the page are the titles: Fox, Bird, and Dog if the ID in the URL is 1 (?id=1), and Cat, Ferret, and Horse if the ID is 2. My question is how would I do this? I assume it would be something like:
mysql_query("SELECT episodes.number, episodes.name, info.number FROM episodes, info");
I'm stuck after that.
I'm currently converting a lot of my website into PHP/SQL. Right now I'm adding a bunch of the data into a database, but I'm having trouble with how I should pull the data and display it on the page.
I have a table that has TV show episodes data. In one column is the number and the other column has the name. In another table I have a column that has an ID and the other is a number. That number in the second column will relate to the number in the TV show episodes. Here's a diagram that shows what I'm talking about:
http://img.photobucket.com/albums/v91/SableyeRULES/diagram.png
So what should be displayed on the page are the titles: Fox, Bird, and Dog if the ID in the URL is 1 (?id=1), and Cat, Ferret, and Horse if the ID is 2. My question is how would I do this? I assume it would be something like:
mysql_query("SELECT episodes.number, episodes.name, info.number FROM episodes, info");
I'm stuck after that.