medz Posted July 23, 2010 Share Posted July 23, 2010 I just downloaded latest version[ 2.0.2b (Build: 20202)],and found cant edit rank of job in admin panel,it goes to: QUERY ERROR: You have an error in your SQL syntax whatever you put in thanks! Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted July 23, 2010 Share Posted July 23, 2010 post that section of code. Quote Link to comment Share on other sites More sharing options...
medz Posted July 23, 2010 Author Share Posted July 23, 2010 do you mean error infor? 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 'jrID=1' at line 1 Query was UPDATE jobranks SET jrNAME='kid', jrJOB = 2, jrPAY= 100, jrIQG=2, jrLABOURG=2, jrSTRG=2, jrIQN=1, jrLABOURN=1, jrSTRN=1WHERE jrID=1 Quote Link to comment Share on other sites More sharing options...
Dominion Posted July 23, 2010 Share Posted July 23, 2010 i think he means the part of the page that is erroring just post the whole page if your not sure Quote Link to comment Share on other sites More sharing options...
medz Posted July 24, 2010 Author Share Posted July 24, 2010 i think he means the part of the page that is erroring just post the whole page if your not suresource code? Sorry,I know nothing about coding. Thanks! Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted July 24, 2010 Share Posted July 24, 2010 Why you trying to run a game then? Quote Link to comment Share on other sites More sharing options...
medz Posted July 24, 2010 Author Share Posted July 24, 2010 already submited ticket to mc support Thanks :) Quote Link to comment Share on other sites More sharing options...
NarutoPRG.com Posted July 24, 2010 Share Posted July 24, 2010 Why you trying to run a game then? My thoughts exactly. Quote Link to comment Share on other sites More sharing options...
r14170 Posted July 25, 2010 Share Posted July 25, 2010 this is staff_jobs.php where you can edit jobs rank <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains shop stuffs switch($_GET['action']) { case 'newjob': newjob(); break; case 'jobedit': jobedit(); break; case 'newjobrank': newjobrank(); break; case 'jobrankedit': jobrankedit(); break; case 'jobdele': jobdele(); break; case 'jobrankdele': jobrankdele(); break; default: print "Error: This script requires an action."; break; } function newjob() { global $db,$ir,$userid; if ( $_POST['jNAME']) { $db->query("INSERT INTO jobs VALUES('','{$_POST['jNAME']}', 0, '{$_POST['jDESC']}', '{$_POST['jOWNER']}')"); $i=$db->insert_id(); $db->query("INSERT INTO jobranks VALUES('', '{$_POST['jrNAME']}', $i, {$_POST['jrPAY']}, {$_POST['jrIQG']}, {$_POST['jrLABOURG']}, {$_POST['jrSTRG']}, {$_POST['jrIQN']}, {$_POST['jrLABOURN']}, {$_POST['jrSTRN']})"); $j=$db->insert_id(); $db->query("UPDATE jobs SET jFIRST=$j WHERE jID=$i"); print "Job created! "; } else { print <<<EOF <form action='staff_jobs.php?action=newjob' method='post'> [b]Job Name:[/b] <input type='text' name='jNAME' /> [b]Job Description:[/b] <input type='text' name='jDESC' /> [b]Job Owner:[/b] <input type='text' name='jOWNER' /> <hr>[b]First Job Rank:[/b] [b]Rank Name:[/b] <input type='text' name='jrNAME' /> [b]Pays:[/b] <input type='text' name='jrPAY' /> [b]Gains:[/b] Str: <input type='text' name='jrSTRG' size=3 maxlength=3> Lab: <input type='text' name='jrLABOURG' size=3 maxlength=3> IQ: <input type='text' name='jrIQG' size=3 maxlength=3> [b]Reqs:[/b] Str: <input type='text' name='jrSTRN' size=5 maxlength=5> Lab: <input type='text' name='jrLABOURN' size=5 maxlength=5> IQ: <input type='text' name='jrIQN' size=5 maxlength=5> <input type='submit' value='Create Job' /></form> EOF; } } function jobedit() { global $db,$ir,$userid; if ( $_POST['stage2']) { $db->query("UPDATE jobs SET jNAME='{$_POST['jNAME']}', jDESC='{$_POST['jDESC']}', jOWNER='{$_POST['jOWNER']}', jFIRST={$_POST['jFIRST']} WHERE jID={$_POST['jID']}"); print "Job updated! "; } else if ( $_POST['stage1']) { $q=$db->query("SELECT * FROM jobs WHERE jID={$_POST['jID']}"); $r=$db->fetch_row($q); print <<<EOF <form action='staff_jobs.php?action=jobedit' method='post'> <input type='hidden' name='stage2' value='1'> <input type='hidden' name='jID' value='{$_POST['jID']}'> [b]Job Name:[/b] <input type='text' name='jNAME' value='{$r['jNAME']}'> [b]Job Description:[/b] <input type='text' name='jDESC' value='{$r['jDESC']}'> [b]Job Owner:[/b] <input type='text' name='jOWNER' value='{$r['jOWNER']}'> [b]First Job Rank:[/b] EOF; print jobrank_dropdown($c,'jFIRST',$r['jFIRST']); print <<<EOF <input type='submit' value='Edit' /> </form> EOF; } else { print <<<EOF <form action='staff_jobs.php?action=jobedit' method='post'> <input type='hidden' name='stage1' value='1'> Select a job to edit. EOF; print job_dropdown($c, 'jID', -1); print <<<EOF <input type='submit' value='Edit Job' /> </form> EOF; } } function newjobrank() { global $db,$ir,$userid; if ( $_POST['jrNAME']) { $db->query("INSERT INTO jobranks VALUES('', '{$_POST['jrNAME']}', {$_POST['jrJOB']}, {$_POST['jrPAY']}, {$_POST['jrIQG']}, {$_POST['jrLABOURG']}, {$_POST['jrSTRG']}, {$_POST['jrIQN']}, {$_POST['jrLABOURN']}, {$_POST['jrSTRN']})"); print "Job rank created! "; } else { print <<<EOF <form action='staff_jobs.php?action=newjobrank' method='post'> [b]Rank Name:[/b] <input type='text' name='jrNAME' /> [b]Pays:[/b] <input type='text' name='jrPAY' /> [b]Job:[/b] EOF; print job_dropdown($c,"jrJOB", -1); print <<<EOF [b]Gains:[/b] Str: <input type='text' name='jrSTRG' size=3 maxlength=3> Lab: <input type='text' name='jrLABOURG' size=3 maxlength=3> IQ: <input type='text' name='jrIQG' size=3 maxlength=3> [b]Reqs:[/b] Str: <input type='text' name='jrSTRN' size=5 maxlength=5> Lab: <input type='text' name='jrLABOURN' size=5 maxlength=5> IQ: <input type='text' name='jrIQN' size=5 maxlength=5> <input type='submit' value='Create Job Rank' /></form> EOF; } } function jobrankedit() { global $db,$ir,$userid; if ( $_POST['stage2']) { $db->query("UPDATE jobranks SET jrNAME='{$_POST['jrNAME']}', jrJOB = {$_POST['jrJOB']}, jrPAY= {$_POST['jrPAY']}, jrIQG={$_POST['jrIQG']}, jrLABOURG={$_POST['jrLABOURG']}, jrSTRG={$_POST['jrSTRG']}, jrIQN={$_POST['jrIQN']}, jrLABOURN={$_POST['jrLABOURN']}, jrSTRN={$_POST['jrSTRN']}WHERE jrID={$_POST['jrID']}"); print "Job rank updated! "; } else if ( $_POST['stage1']) { $q=$db->query("SELECT * FROM jobranks WHERE jrID={$_POST['jrID']}"); $r=$db->fetch_row($q); print <<<EOF <form action='staff_jobs.php?action=jobrankedit' method='post'> <input type='hidden' name='stage2' value='1'> <input type='hidden' name='jrID' value='{$_POST['jrID']}'> [b]Job Rank Name:[/b] <input type='text' name='jrNAME' value='{$r['jrNAME']}'> [b]Job:[/b] EOF; print job_dropdown($c,'jrJOB',$r['jrJOB']); print <<<EOF [b]Pays:[/b] <input type='text' name='jrPAY' value='{$r['jrPAY']}' /> [b]Gains:[/b] Str: <input type='text' name='jrSTRG' size=3 maxlength=3 value='{$r['jrSTRG']}'> Lab: <input type='text' name='jrLABOURG' size=3 maxlength=3 value='{$r['jrLABOURG']}'> IQ: <input type='text' name='jrIQG' size=3 maxlength=3 value='{$r['jrIQG']}'> [b]Reqs:[/b] Str: <input type='text' name='jrSTRN' size=5 maxlength=5 value='{$r['jrSTRN']}'> Lab: <input type='text' name='jrLABOURN' size=5 maxlength=5 value='{$r['jrLABOURN']}'> IQ: <input type='text' name='jrIQN' size=5 maxlength=5 value='{$r['jrIQN']}'> [b]Job:[/b] <input type='submit' value='Edit' /> </form> EOF; } else { print <<<EOF <form action='staff_jobs.php?action=jobrankedit' method='post'> <input type='hidden' name='stage1' value='1'> Select a job rank to edit. EOF; print jobrank_dropdown($c, 'jrID', -1); print <<<EOF <input type='submit' value='Edit Job Rank' /> </form> EOF; } } function jobrankdele() { global $db,$ir,$userid; if ( $_POST['stage1']) { $q=$db->query("SELECT * FROM jobranks WHERE jrID={$_POST['jrID']}"); $jr=$db->fetch_row($q); $_POST['jID']=$jr['jrJOB']; $db->query("DELETE FROM jobranks WHERE jrID={$_POST['jrID']}"); print "Job rank successfully deleted! "; $db->query("UPDATE users u LEFT JOIN jobs j ON u.job=j.jID SET u.jobrank=j.jFIRST WHERE u.job={$_POST['jID']} and u.jobrank={$_POST['jrID']}"); $q=$db->query("SELECT * FROM jobs WHERE jFIRST={$_POST['jrID']}"); if($db->num_rows($q)) { $r=$db->fetch_row($q); print "[b]Warning![/b] The Job {$r['jNAME']} now has no first rank! Please go edit it and include a first rank. "; } } else { print <<<EOF <form action='staff_jobs.php?action=jobrankdele' method='post'> <input type='hidden' name='stage1' value='1'> Select a job rank to delete. EOF; print jobrank_dropdown($c, 'jrID', -1); print <<<EOF <input type='submit' value='Delete Job Rank' /> </form> EOF; } } function jobdele() { global $db,$ir,$userid; if ( $_POST['stage1']) { $db->query("DELETE FROM jobs WHERE jID={$_POST['jID']}"); print "Job rank successfully deleted! "; $db->query("DELETE FROM jobranks WHERE jrJOB={$_POST['jID']}"); print mysql_affected_rows()." job ranks deleted. "; $db->query("UPDATE users SET job=0,jobrank=0 WHERE job={$_POST['jID']}"); } else { print <<<EOF <form action='staff_jobs.php?action=jobdele' method='post'> <input type='hidden' name='stage1' value='1'> Select a job to delete. EOF; print job_dropdown($c, 'jID', -1); print <<<EOF <input type='submit' value='Delete Job' /> </form> EOF; } } function report_clear() { global $db,$db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?> and the query error: [mysql]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 'jrID=1' at line 1 Query was UPDATE jobranks SET jrNAME='test', jrJOB = 1, jrPAY= 100, jrIQG=1, jrLABOURG=1, jrSTRG=2, jrIQN=1, jrLABOURN=1, jrSTRN=1WHERE jrID=1[/mysql] Quote Link to comment Share on other sites More sharing options...
medz Posted July 26, 2010 Author Share Posted July 26, 2010 yeah,thank you,post source code here 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.