tdktank59 0 Report post Posted November 3, 2006 Hey im working on a scrip that charges a "cartel" for being at war with another "cartel" and i cant seem to get this to work just right... heres what i have so far $cartel = mysql_query("SELECT drugringID FROM drugringwars WHERE drugringID = {$declarer['warDECLARER']} ");while ($ids = mysql_fetch_array($cartel)) { echo "cartel {$ids['drugringID']} has been charged for being at war with another cartel"; $cost = 1000000 * (rand(1,10)); mysql_query("UPDATE drugrings SET drugringdough=drugringdough-{$cost} WHERE drugringID={$ids['drugringID']} "); echo "</br>"; } and these few things may help a bit when trying to help me... the stuff in the while {} works fine just cant get an id from the db so heres a few things drugrings: drugringwars: Share this post Link to post Share on other sites
hts 0 Report post Posted November 3, 2006 $cartel = mysql_query("SELECT drugringID FROM drugringwars WHERE drugringID = {$declarer['warDECLARER']} "); what is the point of getting the value of a mysql field which you already know? Share this post Link to post Share on other sites
tdktank59 0 Report post Posted November 3, 2006 yeah i know lol i cant figure out what to do... i just kept messing with the code till i normaly get it to work... Share this post Link to post Share on other sites
tdktank59 0 Report post Posted November 4, 2006 found the problem thanks for those who tried to help me Share this post Link to post Share on other sites