Hello, does anyone have any idea as to why this piece of code returns no record from the database (the record is definately in there): $query1 = "SELECT * FROM listings WHERE listing_id =1"; $result1 = mysql_query($query1); $num1 = mysql_num_rows($result1); if ($num1 > 1) { // results found echo "$num1 results found.</p>\n"; // Fetch and print all the records. while ($row = mysql_fetch_array($result1, MYSQL_ASSOC)) { echo $row['listing_code']; } I have made the code work with a similar SQL query: "SELECT * FROM listings WHERE site = 1 " the only differences between the column site and listing_id are that listing_id is int and site smallint plus listing_id is auto increment. I have been using navicat as a graphical interface to mysql and both the sql statement runs fine in there and returns records. Any help would be appreciated. Many Thanks