Kyrik Posted August 27, 2007 Share Posted August 27, 2007 How can I retrieve data from my database based on the item's id and how can I built it up on one page dynamically? Thanks, Kyrik Link to comment https://forums.phpfreaks.com/topic/66946-retrieve-info-via-id/ Share on other sites More sharing options...
lemmin Posted August 27, 2007 Share Posted August 27, 2007 Assuming you know how to query your database, use the WHERE clause to set criteria. "WHERE table.ID = 5"; Link to comment https://forums.phpfreaks.com/topic/66946-retrieve-info-via-id/#findComment-335721 Share on other sites More sharing options...
pocobueno1388 Posted August 27, 2007 Share Posted August 27, 2007 By "built it up" you mean, display the information...do something like this: <?php //Fetch the information from the database $query = mysql_query("SELECT * FROM items WHERE itemID='$itemID'")or die(mysql_error()); $row = mysql_fetch_assoc($query); //Now display the information like so echo '<b>Items Name</b>:'.$row['items_name']; ?> Link to comment https://forums.phpfreaks.com/topic/66946-retrieve-info-via-id/#findComment-335723 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.