Trouble running a select query against a database, when I know the connection is working, and the data is there

From: Date: Tue, 13 Apr 2010 08:36:46 +0000
Subject: Trouble running a select query against a database, when I know the connection is working, and the data is there
Groups: php.windows 
Request: Send a blank email to php-windows+get-30018@lists.php.net to get a copy of this message
I am trying to simply just loop through a set of records to spit out <li /> tags for the data therein, and on the same page, it's successfully running another query against the same connection - which I have also tried turning off just in case it was a problem with running two queries against the same connection (really don't think so), but it just tells me there are no records being returned, although I have tried simplifying the sql statement, pulling records from another table, etc. etc., and I really don't know what am doing wrong with this really simple bit of scripting: $qry = mysql_query("select CatName from tblCats where Id = " . $_REQUEST['id']); $arr = mysql_fetch_array($qry); echo "<h2>" . $arr['CatName'] . "</h2>"; //that part works fine $sql = "select Id, CatID, LinkName, LinkDescription, LinkURL from tblLinks where CatID = " . $_REQUEST['id'] . ";"; //the SQL statement seems to come out fine as well if I echo it out to the browser $qry = mysql_query($sql); $arr = mysql_fetch_array($qry); if ($arr.count > 0) { echo "<ul>"; while($row = mysql_fetch_array($arr)) { echo "<li>" . $row['LinkName'] . " - " . $row['LinkDescription'] . " - "; echo "<a href='" . $row['LinkURL'] . "' target='_blank'>" . $row['LinkURL'] . "</a></li>"; } echo "</ul>"; } else { echo "no links in category"; } mysql_close($con); It permanently just keeps on deciding there are no rows to output, so I'm a bit confused at the moment. Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' __________ Information from ESET NOD32 Antivirus, version of virus signature database 5023 (20100412) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com

« previous php.windows (#30018) next »