Jump to content
MakeWebGames

Job Rank editing.


gurpreet

Recommended Posts

So I fixed my job pay / job stat gains every day.

 

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=19' at line 1
Query was UPDATE jobranks SET jrNAME='Leader', jrJOB = 6, jrPAY= 50000, jrIQG=300, jrLABOURG=700, jrSTRG=900, jrIQN=1000, jrLABOURN=2000, jrSTRN=10000WHERE jrID=19

 

That's what I get when editing a job rank.

Here's the first part of my function job rank edit

 

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!

Any ideas?

Link to comment
Share on other sites

Re: Job Rank editing.

 

global $db, $ir, $userid;
if($_POST['stage2'])
{
$sql = sprintf("UPDATE jobranks SET jrNAME = '%s', jrJOB = '%u', jrPAY = '%u', jrIQG = '%u' jrLABOURG = '%u', jrSTRG = '%u', jrIQN = '%u', jrLABOURN = '%u', jrSTRN = '%u' WHERE jrID = '%u' ",
   ($_POST['jrNAME']),
   ($_POST['jrJOB']),
   ($_POST['jrPAY']),
   ($_POST['jrIQG']),
   ($_POST['jrLABOURG']),
   ($_POST['jrSTRG']),
   ($_POST['jrIQN']),
   ($_POST['jrLABOURN']),
   ($_POST['jrSTRN']),
   ($_POST['jrID']));
       mysql_query($sql);

echo "Job rank updated!

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