View Single Post
Old 06-12-2008, 07:56 PM   #2 (permalink)
buggabill
The Contributor
 
buggabill's Avatar
 
Join Date: Jan 2008
Location: Maine, USA
Posts: 92
Thanks: 2
buggabill is on a distinguished road
Default

You need to run mysql_query on those sql strings.

Like this:
php Code:
$sql1 = "select * from table";
$sql2 = "select * from anothertable";

$result1 = mysql_query($sql1);
$result2 = mysql_query($sql2);

while($row1 = mysql_fetch_assoc($result1)) {

     // do something

         while($row = mysql_fetch_assoc($result2)) {


      // do something else

}
}

mysql_fetch_assoc works on valid mysql result sets and not on strings that are intended to be queries.
__________________
-- Bill
"Why is it drug addicts and computer aficionados are both called users?" -Clifford Stoll
buggabill is offline  
Reply With Quote