Jump to content
MakeWebGames

Recommended Posts

Posted

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

Posted

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?

Posted

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:.

Posted

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.

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...