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 Quote 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"; Quote 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']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/66946-retrieve-info-via-id/#findComment-335723 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.