Query variables:
Echo "Pound $pound: & pussy: $a_cat<br>";
$query = "SELECT pound FROM rspca WHERE a_cat=$a_cat";
$category = mysql_query($db, $query);
if (!$category) {
echo "Error1 connecting to the table.<br>\n";
} else {
//check whether cat lives in another pound ?!
if ($row = mysql_fetch_array($category)){
while ($row){ ß----------- IS THIS VALID?!
$match = $row['a_cat'];
if ($a_cat == $match) {
$pound = $row['pound'];
echo "Also exist in $pound";
}
}
//$error = 1;
//$error_array[] = "<i>This cat already exists in the database.</i>";
}
}
I am trying to loop through the whole database searching for a match in all table records! IS there an more efficient way… mysql_fetch_field? But that is for a table record. I want to check with all table records in the database… Anyone get me? HELP HELP?
Mandar Kelkar wrote:
Just echo
$sql="SELECT male FROM people WHERE age=$old";
mysql_query($sql);
see what echo show asin if really $old has some value.
Other problem is
mysql_query($sql,$db);
$db is not given in second case
Try using mysql_error() see what it show.
I hope its showing no database selected
Mandar