FuDge Posted August 19, 2009 Share Posted August 19, 2009 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. Quote Link to comment Share on other sites More sharing options...
wolfe Posted August 19, 2009 Share Posted August 19, 2009 Re: Gang Error Hard to tell with that chunk of code. Do you have values for gangMOD1 and gangMOD2? Are they already inside your gang table? Quote Link to comment Share on other sites More sharing options...
FuDge Posted August 20, 2009 Author Share Posted August 20, 2009 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? Quote Link to comment Share on other sites More sharing options...
Dave Posted August 20, 2009 Share Posted August 20, 2009 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. Quote Link to comment Share on other sites More sharing options...
FuDge Posted August 23, 2009 Author Share Posted August 23, 2009 Re: Gang Error I got it, wolfe helped me. Thanks though. 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.