dementor Posted November 19, 2007 Share Posted November 19, 2007 i got something wrong with my create gang .php i mean the gangs dont even come up in the DB when made <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.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['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); $gangs=mysql_num_rows(mysql_query("SELECT gangID FROM gangs",$c)); $gangprice=$gangs*5000; mysql_query("UPDATE users SET gang=$i,money=money-$gangs*5000 where userid=$userid",$c); if($ir['money'] < $gangs*5000) { die("You don't have enough money gangster. You need \$$gangprice so get hustling."); } if($ir['gang']) { die ("You're already in a gang you aint loyal!"); } 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,'', '',0,0)",$c); $i=mysql_insert_id($c); mysql_query("UPDATE users SET gang=$i,money=money-$gangs*5000 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 \$$gangprice ' /></form>"; } $h->endpage(); ?> see anything wrong ? Quote Link to comment Share on other sites More sharing options...
dementor Posted November 19, 2007 Author Share Posted November 19, 2007 Re: problem nope but i see where your going Quote Link to comment Share on other sites More sharing options...
dementor Posted November 19, 2007 Author Share Posted November 19, 2007 Re: problem ive fixed it i was just inputing to many values 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.