At 10:58 PM 12/7/2006, [EMAIL PROTECTED] wrote:
After a lot of trial and error I've narrowed down the offending query in my problem with sql results not freeing themselves up:

$query = mysql_query("SELECT activeID FROM activeAI WHERE locationID='$locationID' AND activeID <> '$activeID' AND isUndead=0");
$numOtherAI = mysql_num_rows($query);
mysql_free_result($query);

When I comment out this query, the error(s) go away. Variables $locationID and $activeID are both properly set.

You really should check for errors when doing a mysql_query. Putting the query in a separate string helps.

$q = "SELECT activeID FROM activeAI WHERE locationID='$locationID' AND activeID <> '$activeID' AND isUndead=0";
$rs = mysql_query($q) or die("Problem with the query: $q<br>" . mysql_error());
$numOtherAl = mysql_num_rows($rs);
mysql_free_result($rs);

Ken


_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to