I wrote this script like this
$sql = mysql_query("SELECT * FROM shops WHERE userid = $id");
if ($row = mysql_fetch_array($sql)) {
echo $row['name'];
}
else {
echo 'No Shop for this user';
}
As you probebly can I see get an error if there is not record where userid = $id, so how do I check if a record exist or eval if I get a return from a query?
Thanks