help - I have 2 tables and use the following code to pull the info I need out of them. When I run the query through mysql on the server it returns the correct results but when run in this code it returns nothing - no error either. you can see the commented out sql that I originally used and this worked fine. so why am I not seeing the returned results??????
<?php
//$result = mysql_query("SELECT * FROM comments where regardingid=$id",$db);
$results = mysql_query("select * from pdl, comments where pdl.id = comments.regardingid and comments.regardingid=$id",$db);
echo"<table border=1 width=\"100%\">\n";
echo"<tr><td>Left by -</td><td>Comment</td></tr>";
while ($myrow = mysql_fetch_array($result)) {
printf("<tr><td><a href=\"%s?id=%s\">%s </a></td><td>%s\n</td></tr> ", $PHP_SELF, $myrow["leftbyid"] ,$myrow["leftbyid"], $myrow["comment"]);
}
printf("</table>");
?>