Darkmatter5 Posted June 5, 2008 Share Posted June 5, 2008 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! Quote Link to comment Share on other sites More sharing options...
mdnghtblue Posted June 5, 2008 Share Posted June 5, 2008 Don't you need to set address, city, zip_code, etc, to a value? Like this: UPDATE byrnjobdb.employees SET address='123', city='Kingsbury', zip_code='78638', home_phone='555-555-5555', active_employee='Yes', lic_rpls='No', lic_pe='No' WHERE employee_id=7 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.