grlayouts Posted September 15, 2006 Share Posted September 15, 2006 ok i have a game where when people go to make a gang it should update in to places, but when i try to get the gang name to update in the players tab it doesnt work..This is what i have?[code]if ($step == make) { if ($stat[taxdebt] > 0) { print "<br><font color=red>You cannot make a Gang without <b>paying</b> your taxes. Sorry!</font><br>Right now you owe <b>$stat[taxdebt]</b>!"; include("footer.php"); exit; } if ($stat[credits] < 10000) { print "You don't have enough credits to make a gang."; quit(); } if ($stat[triad]) { print "You're already in a gang. Try quitting the one your in first."; quit(); } print "<form method=post action=zones.php?step=make&action=go>"; print "I want my gang to be called <input type=text name=tname>. <input type=submit value=Make>"; print "</form>"; if ($action == go) { $numt = mysql_num_rows(mysql_query("select * from triads where name='$tname'")); if ($numt > 0) { print "There is already a gang by that name."; quit(); } print "You have made the gang called <a href=zones.php?step=my>[$tname]</a>."; mysql_query("insert into triads (name,owner) values('$tname',$stat[id])"); $myt = mysql_fetch_array(mysql_query("select * from triads where name='$tname'")); $geting = mysql_query("SELECT * FROM players WHERE where id='$stat[id]"); $getto = mysql_result($getting); mysql_query("update players set triad=$myt[id] where id=$stat[id]"); mysql_query("update players set zone1=$myt[name] where id=$getting[id]"); mysql_query("update players set credits=credits-10000 where id=$stat[id]");[/code] Quote Link to comment Share on other sites More sharing options...
grlayouts Posted September 16, 2006 Author Share Posted September 16, 2006 no one?? Quote Link to comment Share on other sites More sharing options...
SDraconis Posted September 16, 2006 Share Posted September 16, 2006 Just off the top of my head I want to ask what exactly you mean by "it doesn't work". Do you mean the table isn't being updated?Couple debugging tips: 1.) Print your queiries out so you can see what is being sent to your DB2.) Make sure all the mysql_query calls that do updates return TRUE. If not, make use of the mysql_error function. 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.