Code problem - need help.

From: Date: Sun, 12 Jan 2003 08:30:35 +0000
Subject: Code problem - need help.
Groups: php.db 
Request: Send a blank email to php-db+get-24782@lists.php.net to get a copy of this message
Hello all, I have the following code: echo "<td>\n"; echo "<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"2\">\n"; $sql2 = mysql_query("SELECT signature FROM event ORDER BY cid DESC LIMIT 10"); while ($row = mysql_fetch_array($sql2)) { // $cid_alert = $row["cid"]; $number = $row["signature"]; $name = mysql_query("SELECT sig_name FROM signature WHERE sig_id = $number"); echo "<tr><td><p>$number</p></td><td><p>$name</p></td></tr>\n"; } echo "</table>\n"; echo "</td>\n"; When I view on my web page, the $number value comes out fine, but the $name comes out as "Resource ID #x" where x is some number. Currently is says "Resource ID #6". I know the SQL syntax is right, I have tested it. But what is wrong here? I have tried putting single quotes around $number in my query statement. It dod not work though. If anyone can help, it is greatly appreciated!!! Thanks, R Clark

« previous php.db (#24782) next »