Jump to content

Simple UPDATE question


Darkmatter5

Recommended Posts

Here's my UPDATE:

UPDATE byrnjobdb.employees SET address, city, zip_code, home_phone, active_employee, lic_rpls, lic_pe='123', 'Kingsbury', '78638', '555-555-5555', 'Yes', 'No', 'No' WHERE employee_id=7

 

If my table is like this:

CREATE TABLE `employees` (
  `employee_id` int(11) NOT NULL auto_increment,
  `first_name` varchar(50) NOT NULL,
  `last_name` varchar(50) NOT NULL,
  `address` varchar(50) default NULL,
  `city` varchar(50) default NULL,
  `state_id` int(11) default NULL,
  `zip_code` varchar(10) default NULL,
  `home_phone` varchar(12) default NULL,
  `cell_phone` varchar(12) default NULL,
  `active_employee` enum('No','Yes') NOT NULL default 'Yes',
  `lic_rpls` enum('No','Yes') NOT NULL default 'No',
  `lic_pe` enum('No','Yes') NOT NULL default 'No',
  PRIMARY KEY  (`employee_id`),
  KEY `fk_state_id` (`state_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

 

Why am I getting the following error:

#1064 - 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 ' city, zip_code, home_phone, active_employee, lic_rpls, lic_pe='123', 'Kingsbury' at line 1 

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/108855-simple-update-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.