doinkinator Posted April 16, 2009 Posted April 16, 2009 i have a issue with v2 of mccodes in staff panel i cant create a crime it give me a query error QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 0, '2', '', '', '', '', , '', )' at line 1 *** on top of this when i create a new city it dnst do anything just redirects back to the create form no error msg but no city either if you could help me i would appriciate it thanks Quote
Strats Posted April 16, 2009 Posted April 16, 2009 Re: Creat Crime and City I ad the same problem with my crimes, best thing is to ask to someones staff panel on the game to take a look at how they are layed out. Did you by your codes properly or download them from a site? Quote
Karlos Posted April 16, 2009 Posted April 16, 2009 Re: Creat Crime and City I get people asking this alot... the simple fix.... Create Item 1) Delete you codes.... 2) Code... 3) Fill in all the boxes. Create City function addcity() { global $db, $ir, $c, $h, $userid; $minlevel=abs((int) $_POST['minlevel']); $name=$_POST['name']; $desc=$_POST['desc']; if($minlevel and $desc and $name) { $q=$db->query("SELECT * FROM cities WHERE cityname='{$name}'"); if($db->num_rows($q)) { print "Sorry, you cannot have two cities with the same name."; $h->endpage(); exit; } $db->query("INSERT INTO cities VALUES (NULL, '$name', '$desc', '$minlevel')"); print "City {$name} added to the game."; stafflog_add("Created City $name"); } else { print "<h3>Add City</h3><hr /> <form action='staff_cities.php?action=addcity' method='post'> Name: <input type='text' name='name' /> Description: <input type='text' name='desc' /> Minimum Level: <input type='text' name='minlevel' /> <input type='submit' value='Add City' /></form>"; } } I think (Never tested it, done ages ago (might have a look if you ask nicely xD)) :wink:. Quote
doinkinator Posted April 17, 2009 Author Posted April 17, 2009 Re: Creat Crime and City Thanks that worked very well! Quote
(((TOLK))) Posted April 18, 2009 Posted April 18, 2009 Re: Creat Crime and City You get the problem with the crimes if u don't fill in the boxes and the original add city code was missing a (') somewhere in the code Karlos has posted the fix. 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.