WarMad Posted November 21, 2013 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
Guest Posted November 21, 2013 Posted November 21, 2013 Turn on errors, look through the logs find the error Quote
SRB Posted November 21, 2013 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
WarMad Posted November 21, 2013 Author 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
SRB Posted November 22, 2013 Posted November 22, 2013 Problem was? I am guessing incorrect column count... Quote
WarMad Posted November 25, 2013 Author Posted November 25, 2013 ya thats exactly what it was - - - Updated - - - ya thats exactly what it was Quote
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.