0

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\firewall\php\allresults.php on line 3

The annoying thing is, I have used this multiple times on different applications, I dont know why it think the result is boolean?
the exact same code works on a different database, I just cant see why it wont work here?

Many Thanks

<?php
$result = mysql_query("SELECT * FROM device");
while($row = mysql_fetch_array($result)){
$id = $row['id'];
$name= $row['name'];
$access = $row['access'];
$type= $row['type'];
$customer= $row['customer'];
$make = $row['make'];
$model = $row['model'];
$serial = $row['serial'];
$os  =$row['os'];
$software = $row['software'];
$smartcenter = $row['smartcenter'];
echo $id ."<br />". $name;
}
?>
2
Contributors
4
Replies
11
Views
3 Years
Discussion Span
Last Post by websponge
0

there is an include statement (I didnt post it) it does work as I dont get the "cannot connect" error

0

it was returning "no database selected" which is very strange as I include the connection parameters, Its all fixed now - I included the connection file within the same page as the query page. sorry for wasting your time, thanks for replying though.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.