Jump to content
MakeWebGames

Gang Error


FuDge

Recommended Posts

The past couple days ive been wanting to make more Gang Positions for mccodes v2. Last night i created them but when i view the pages this shows.

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 '' at line 1

Query was SELECT * FROM users WHERE userid=

Im not entirly sure whats wrong. But i believe the error is somehow in here or has to do with the sql, its been along day and i hardly had any sleep as ive been up looking every were trying to figure this out. I may sound a little noobish or what not but idk why its like this.

 

$pq=$db->query("SELECT * FROM users WHERE userid={$gangdata['gangPRESIDENT']}");
$ldr=$db->fetch_row($pq);
$vpq=$db->query("SELECT * FROM users WHERE userid={$gangdata['gangVICEPRES']}");
$coldr=$db->fetch_row($vpq);
$m1q=$db->query("SELECT * FROM users WHERE userid={$gangdata['gangMOD1']}");
$mod1=$db->fetch_row($m1q);
$m2q=$db->query("SELECT * FROM users WHERE userid={$gangdata['gangMOD2']}");
$mod2=$db->fetch_row($m2q);

 

Everything else that i have done is based off of here. Id really appreciate any help that you can offer.

Link to comment
Share on other sites

Re: Gang Error

Thats what i had forgotten to do, but when i did add them the error went away and when i tried to give the position to someone it came up with..

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 'AND gang=2' at line 1

Query was SELECT * FROM users WHERE userid= AND gang=2

What happened?

Link to comment
Share on other sites

Re: Gang Error

Thats what i had forgotten to do, but when i did add them the error went away and when i tried to give the position to someone it came up with..

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 'AND gang=2' at line 1

Query was SELECT * FROM users WHERE userid= AND gang=2

What happened?

It's not pulling the userid out for some reason, Check to make sure the var your using for the userid is working correctly.

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