Reply to mysql UPDATE syntax

Your name:

Reply:


Posted by Mark D. Smith on 04/21/06 19:17

Hi

i am trying to update a group of values in 1 table all at once.

my sql string is

$sql = "UPDATE job_adverts (Posted_ID, Date_Posted, Job_Title, Job_Code,
Job_Location, Job_Salary, Job_Description, Company_image, Contact_Name,
Contact_Email, Contact_Web, Contact_Company, Contact_Address,
Contact_Telephone, Contact_Fax, company_id, views) SET ('$Posted_ID',
'$Date_Posted', '$Job_Title', '$Job_Code', '$Job_Location', '$Job_Salary',
'$Job_Description', '$Nom_Image', '$Contact_Name', '$Contact_Email',
'$Contact_Web', '$Contact_Company', '$Contact_Address',
'$Contact_Telephone', '$Contact_Fax', '$company_id', '$views') WHERE
ID='$ID'";

but this fails, how should i re-write it? its based on the INSERT INTO code
below which works.

$sql = "INSERT INTO job_adverts (ID, Posted_ID, Date_Posted, Job_Title,
Job_Code, Job_Location, Job_Salary, Job_Description, Company_image,
Contact_Name, Contact_Email, Contact_Web,
Contact_Company, Contact_Address, Contact_Telephone, Contact_Fax,
company_id, views) VALUES ('$ID', '$Posted_ID', '$Date_Posted',
'$Job_Title', '$Job_Code', '$Job_Location', '$Job_Salary',
'$Job_Description',
'$Nom_Image', '$Contact_Name', '$Contact_Email', '$Contact_Web',
'$Contact_Company', '$Contact_Address', '$Contact_Telephone',
'$Contact_Fax', '$company_id', '0')";


Mark

--
--
Obantec Support
www.obantec.net
0845 458 3121
WebHosting and Domains
Nominet UK Member & IPStag Holder
CentralNic Accredited Reseller

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация