Jump to content

hmjb

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

hmjb's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hmjb

    Newbie SQL issue!

    Oh GOD! Thank you so much, dumb mistake but I wasted a whole afternoon!!!
  2. 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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.