SitePoint Sponsor

User Tag List

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

    SQL syntax error

    this is the error
    Warning: Supplied argument is not a valid MySQL result resource in c:\apache\htdocs\gp1\admin\inbox.php on line 5
    this is the code
    Code MySQL:
    $result4 = mysql_query("SELECT * FROM admin_com WHERE title='$id'");
    while($row = mysql_fetch_array($result4)) -------> this is line 5 in my code
    	{
    	echo "<table border='0'> 
    	<tr>
    	<td>Message Title : </td> 
    	<td>" . $row['title'] . "</td> 
    	</tr>
    	<tr>
    	<td>Req. Sender Name : </td> 
    	<td>" . $row['name'] . "</td> 
    	</tr>
    	<tr>
    	<td>Req. Sender User : </td> 
    	<td>" . $row['user'] . "</td> 
    	</tr> 
    	<tr>
    	<td>Requested Message : </td> 
    	<td>" . $row['comment'] . "</td> 
    	</tr>";
    	echo "</table>";  
    	}

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    453
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It means your query is not returning a result set. Have you established a connection and selected a data base before this query ? Is $id a valid title ?
    Is there any matches in the data base for this title ?
    Computers and Fire ...
    In the hands of the inexperienced or uneducated,
    the results can be disastrous.
    While the professional can tame, master even conquer.

  3. #3
    SitePoint Addict einSTein's Avatar
    Join Date
    Aug 2006
    Posts
    276
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx alot man


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
  •