links

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PHPNERD
Forum Newbie
Posts: 4
Joined: Tue Mar 07, 2006 12:35 pm

links

Post by PHPNERD »

Is there a way to store links inside a mysql database? I want to display each different link as the word "preview" for the products I sell. I could make a field and have "preview" for each item, but then how could i assign a different link (each link would point to a dfiferent file) for each?
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

Store all the product information in a database table with an ID, then use

Code: Select all

print "<a href=\"object.php?id=".$database_id_variable."\">Preview</a>";
Then build the object.php page using the information from the database, and the SQL you need will end

Code: Select all

$query= "...WHERE id = $"._GET['id'];
Post Reply