Jump to content

[RESOLVED] Simple, short script reaches maximum execution time.. ?


kernelgpf

Recommended Posts

$query=mysql_query("select todragonID,fromdragonID from dragonsmating");
$num=mysql_fetch_array($query);
for($i=0;$i<$num;$i++){
$row=mysql_fetch_array($query);
mysql_query("update dragons set atcave='yes' where id='$row[todragonID]'");
mysql_query("update dragons set atcave='yes' where id='$row[fromdragonID]'");
}
mysql_query("truncate dragonsmating");

 

I've looked at it over and over again.. what's wrong with it?

also... its much easier to do it this way... no icky stuffs... just plain and simple :-)

 

$query=mysql_query("select todragonID,fromdragonID from dragonsmating");
while($row=mysql_fetch_array($query)){
mysql_query("update dragons set atcave='yes' where id='$row[todragonID]'");
mysql_query("update dragons set atcave='yes' where id='$row[fromdragonID]'");
}
mysql_query("truncate dragonsmating");

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.