WarMad Posted November 21, 2013 Share Posted November 21, 2013 im not sure whats wrong it says gang created but all it does is take the money and does not inter in into the database not the info under users or under gangs global $ir, $userid; $c= 1000000; if($ir['money'] < $c) { die("You don't have enough money. You need \${$c}."); } if($ir['gang']) { die ("You're already in a gang!"); } if($_POST['submit']) { $name=htmlspecialchars($_POST['name']); $desc=htmlspecialchars($_POST['desc']); mysql_query("INSERT INTO gangs VALUES('','$name','$desc','','','','',0,0,100,$userid,$userid,5,0,0,'')"); $i=mysql_insert_id(); mysql_query("UPDATE users SET gang=$i,money=money-$c where userid=$userid"); echo "gang created!"; } else { echo "<h3> Create A gang</h3><form action='creategang.php' method='post'> <input type='hidden' name='submit' value='1' />Name:<input type='text' name='name' /><br /> Description:<br /> <textarea name='desc' cols='40' rows='7'></textarea> <br /><input type='submit' value='Create gang for \${$c}' /></form>"; } Quote Link to comment Share on other sites More sharing options...
Guest Posted November 21, 2013 Share Posted November 21, 2013 Turn on errors, look through the logs find the error Quote Link to comment Share on other sites More sharing options...
SRB Posted November 21, 2013 Share Posted November 21, 2013 Add error reporting to this line; mysql_query("INSERT INTO gangs VALUES('','$name','$desc','','','','',0,0,100,$userid,$userid,5,0,0,'')"); To become; mysql_query("INSERT INTO gangs VALUES('','$name','$desc','','','','',0,0,100,$userid,$userid,5,0,0,'')") or die (mysql_error()); And see what error it tells you. Quote Link to comment Share on other sites More sharing options...
WarMad Posted November 21, 2013 Author Share Posted November 21, 2013 doing that now thanks lol i havent coded in a while im trying to get back into it still refreshing my mind Quote Link to comment Share on other sites More sharing options...
WarMad Posted November 21, 2013 Author Share Posted November 21, 2013 thanks guys i fixed it Quote Link to comment Share on other sites More sharing options...
SRB Posted November 22, 2013 Share Posted November 22, 2013 Problem was? I am guessing incorrect column count... Quote Link to comment Share on other sites More sharing options...
WarMad Posted November 25, 2013 Author Share Posted November 25, 2013 ya thats exactly what it was - - - Updated - - - ya thats exactly what it was 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.