Jump to content
MakeWebGames

Create gang not working :/


WarMad

Recommended Posts

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>";
}
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...