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

Updated looks like a column name rather than a string. As has already been pointed out, non-numeric values need to be quoted.


What's up? What's wrong with my code? The first line in the page is a link
to the connections file.

Robb

I'm also curious why you are bothering with sprintf. Try this

$updateSQL = "UPDATE JL_Resumes
              SET DateEdited='$dateEdited', Status='$status'
              WHERE ResumeID=$resumeID";

(I'm assuming ResumeID is numeric.)

Michael




-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to