
gkornbluth
Veteran
Dec 15, 2011, 3:47 PM
Post #3 of 5
(270 views)
Shortcut
|
|
Re: [Jason] Update a record based on matching field value in form
[In reply to]
|
Can't Post
|
|
Hi Jason, I thought I would have to put in a where clause but I kept getting syntax errors every time I tried to put one in. I'm still getting a syntax error:
MySQL Error updating Record: 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 'WHERE activation_code = 'T87345'' at line 19 Here's the actual code that's generating the error (with or without the load records call): //load records list($customer_uploadsRecords, $customer_uploadsMetaData) = getRecords(array( 'tableName' => 'customer_uploads', )); mysql_query("UPDATE `{$TABLE_PREFIX}customer_uploads` SET email = '".$email."', first_name = '".$first_name."', last_name = '".$last_name1."', street_address = '".$street_address."', city = '".$city."', state = '".$state."', zip = '".$zip."', sales_id = '".$sales_id."', createdDate = NOW(), updatedDate = NOW(), createdByUserNum = '0', updatedByUserNum = '0', WHERE activation_code = '".mysql_escape($activation_code)."'") or die("MySQL Error updating Record:<br/>\n". htmlspecialchars(mysql_error()) . "\n"); $userNum = mysql_insert_id(); @saveUploadFromFilepath('customer_uploads', 'uploads', $userNum, '123456789' , $path_of_uploaded_file); $errors='Thank You<br /><br />Your Portrait Order Has Been Successfully Placed.'; } ?> ANd I've attached the complete file The first CMS Builder reference book is now available on-line! http://www.thecmsbcookbook.com
|