SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict einSTein's Avatar
    Join Date
    Aug 2006
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql Syntax error

    Code MySQL:
    $result2 = mysql_query("SELECT * FROM postjobs WHERE title='$id'"); 
    echo "<center>";
    echo "<table border='0'> 
    <td>
    <th>No.&nbsp;&nbsp;&nbsp;  </th> 
    <th>Job Titles&nbsp;&nbsp;&nbsp;  </th> 
    </tr>"; 
    while($row2 = mysql_fetch_array($result2)) ------> error line
        { 
        echo '<tr>'; 
        echo '<td>' . $row['user'] . '</td>'; 
        echo '<td>' . $row['title'] . '</td>'; 
        echo '</tr>'; 
        } 
    echo "</table>"; 
    echo "</center>";
    this is my error note: the while line is line 14
    Warning: Supplied argument is not a valid MySQL result resource in c:\apache\htdocs\gp1\ps.php on line 14

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    453
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your mysql query has a syntax problem. The resultset ( $result2 ) is a boolean false because the statement does not execute, not a reocrdset.
    Computers and Fire ...
    In the hands of the inexperienced or uneducated,
    the results can be disastrous.
    While the professional can tame, master even conquer.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •