alright guys, this is what i want:
I want a system that does the following:
-Checks inside a table, and gets ship names from it, then displays them as results (already got this)
but then i want a user to be able to click any one of the ships and find info on it on the next page which comes from another table (which would be the same for each ship, just display differant results, depending on which ship you click)
how would i go about doing this?
I cant see how i would do this, can anyone help?
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Make all of the URLs contain the primary key value of the ship in the query string for a page to display the ships.
i.e.
Then, on that page, use the data from the query string
i.e.
i.e.
Code: Select all
echo '<a href="shipDetails.php?shipId=' . $ship['id'] . '>Details for ' . $ship['name'] . '</a>';i.e.
Code: Select all
mysql_query('SELECT * FROM `ship_details` WHERE `id` = ' . (int)$_GET['shipId']);- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA