DaveMania
May 13th, 2005, 11:44 AM
Basically, I've looked around but I can't find how to create a query that selects from the table where id is the number int he query string of the address e.g. "index.php?id=503" displays the row with the id "503".
Thanks
Ben Smith
May 13th, 2005, 01:16 PM
<?php
$id = (int) $_GET['id'];
$db = mysql_connect(location, username, password);
mysql_select_db("selected database");
if ($isset($id)){
$sql = mysql_query("SELECT * FROM tablename WHERE id = $id");
for($i=1;){
$name of thing = mysql_result($sql,$i,'name of row');
echo "Viewing thing:<br>$name of thing";
}
}else{
//do something else
}?>
Should work, PM/post me if not
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.