query issue
Posted: Fri Aug 31, 2007 11:57 am
Im getting this error with my script :
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\choosehousenumber.php on line 50
Not sure what i have to do to correct this how ever...
Any help is much appreciated!
This is the script:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\choosehousenumber.php on line 50
Not sure what i have to do to correct this how ever...
Any help is much appreciated!
This is the script:
Code: Select all
<?
$GetHouses = mysql_query("SELECT * FROM houses
WHERE * ");
// Fetch the row from the database
if (!($gethousesrow = mysql_fetch_assoc($GetHouses))) {
echo " Any number from 1 to 50!";
}Else{
$num = array();
$query = mysql_query("SELECT HouseNumber FROM houses");
while($result = mysql_fetch_array($query)){
$num[] = $result['HouseNumber'];
}
foreach(range(1, 50) as $p){
if(!in_array($p, $num)){
echo $p." ";
}
}
}
?>