You need to do
PHP Code:
$id= $_POST['id'];
if(is_numeric($id)) // check that its a real number
{
$q = "SELECT * FROM table_name WHERE id=$id"; //since its a number no need to add '".."'
if(mysql_num_rows($q) < 1) // check if theres any results returned
{
//trigger no results error
echo " sorry but that id does not exist";
}
else
{
while($get_all_info = mysql_fetch_assoc($q))
{
$ID = $get_all_info[id];
$INFO = $get_all_info[info];
}
}
the $get_all_info is returned as an associative array with the columns of the table as the array index.