castle Posted July 17, 2008 Share Posted July 17, 2008 suddenly players can not create their own gangs. i did not change anything as far as i know <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['points'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); if($ir['money'] < 500000) { die("You don't have enough money. You need \$500,000."); } 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,'')",$c); $i=mysql_insert_id($c); mysql_query("UPDATE users SET gang=$i,money=money-500000 where userid=$userid",$c); print "Gang created!"; } else { print "<h3> Create A Gang </h3><form action='creategang.php' method='post'><input type='hidden' name='submit' value='1' />Name:<input type='text' name='name' /> Description: <textarea name='desc' cols='40' rows='7'></textarea> <input type='submit' value='Create Gang for \$500,000' /></form>"; } $h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
Tonka Posted July 17, 2008 Share Posted July 17, 2008 Re: create gang have you added or removed anything from the database table? Quote Link to comment Share on other sites More sharing options...
castle Posted July 17, 2008 Author Share Posted July 17, 2008 Re: create gang don't think so but i will check Quote Link to comment Share on other sites More sharing options...
Kasabian Posted July 17, 2008 Share Posted July 17, 2008 Re: create gang have you added gang pictures or summet of the sort? if you are Find: mysql_query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,100,$userid,$userid,5,0,0,'')",$c); Replace: mysql_query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,100,$userid,$userid,5,0,0,'','')",$c); Quote Link to comment Share on other sites More sharing options...
castle Posted July 18, 2008 Author Share Posted July 18, 2008 Re: create gang no, that would produce an error, i am getting no errors Quote Link to comment Share on other sites More sharing options...
Tonka Posted July 18, 2008 Share Posted July 18, 2008 Re: create gang post your DB gangs table Quote Link to comment Share on other sites More sharing options...
castle Posted July 18, 2008 Author Share Posted July 18, 2008 Re: create gang thank you justice and tonka, i did change the table...i feel stupid now :-( :mrgreen: 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.