List:General Discussion« Previous MessageNext Message »
From:Peter Brawley Date:May 15 2005 2:43pm
Subject:Re: What's wrong with this code?
View as plain text  
Robb,

If DateEdited is a datetime col, try "...DateEdited='%s'...", ditto for 
Status if it is not numeric.

PB

-----

Robb Kerr wrote:

>I have the following lines in my PHP doc.
>
> 
>
><?php
>
>mysql_select_db($database_TBAJobLink, $TBAJobLink);
>
>$updateSQL = sprintf("UPDATE JL_Resumes SET DateEdited=%s, Status=%s WHERE
>ResumeID=%s", $dateEdited, $status, $resumeID);
>
>            mysql_query($updateSQL, $TBAJobLink) or die(mysql_error());
>
>            echo 'The JL_Resumes table has been updated.';
>
>?>
>
> 
>
>The three variables - $dateEdited, $status and $resumeID - are defined in
>the top of the page.
>
> 
>
>I'm getting a return of.
>
> 
>
>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 'Updated WHERE
>ResumeID=33' at line 1
>
> 
>
>What's up? What's wrong with my code? The first line in the page is a link
>to the connections file.
>
> 
>
>Robb
>
>
>  
>
>------------------------------------------------------------------------
>
>No virus found in this incoming message.
>Checked by AVG Anti-Virus.
>Version: 7.0.308 / Virus Database: 266.11.9 - Release Date: 5/12/2005
>  
>

Attachment: [text/html]
No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.10 - Release Date: 5/13/2005
Thread
What's wrong with this code?Robb Kerr15 May
  • Re: What's wrong with this code?Peter Brawley15 May
  • Re: What's wrong with this code?Taisuke Yamada15 May