kernelgpf Posted April 20, 2007 Share Posted April 20, 2007 $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? Quote Link to comment Share on other sites More sharing options...
Glyde Posted April 20, 2007 Share Posted April 20, 2007 $num should equal mysql_num_rows($query) instead of mysql_fetch_array($query) Quote Link to comment Share on other sites More sharing options...
taith Posted April 20, 2007 Share Posted April 20, 2007 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"); Quote Link to comment Share on other sites More sharing options...
kernelgpf Posted April 20, 2007 Author Share Posted April 20, 2007 Ah, so easy. Thanks guys. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.