have you ever wondered how to select a single coloumn from mysql using php, then checking whether a value or variable exist in the resulting array... well here is the code
Code:
$busid = '5412';
$results = mysql_query("SELECT `myname` FROM mytable WHERE myuser = 'user'");
while($rows = mysql_fetch_array($results))
{
$colnames[] = $rows['myname'];
}
if(!in_array($busid, $colnames))die("Access denied");
Comment