SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Jan 2004
    Location
    New York
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error in my syntax? I can't see it

    I'm losing hair over this. Please tell me where my syntax is wrong

    Code:
    update
    	setting
    set
    	title 			= 	'blah',
    	uri 			= 	'foo',
    	newscount 		= 	1,
    	timezone 		= 	-5,
    	articlecount 	= 	10,
    	showlength 		= 	150,
    	absolutepath 	= 	'/blah/etc/etc/'
    where
    	setting_id 		= 	1
    This is what the error said:

    Notice: 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 ' showlength = 150, absolutepath = '/blah/etc/etc' in ...

  2. #2
    SitePoint Guru MikeBigg's Avatar
    Join Date
    Jun 2004
    Location
    Reading, UK
    Posts
    970
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't see it either. Can you post your table definition?

    Mike

  3. #3
    SitePoint Addict
    Join Date
    Jan 2004
    Location
    New York
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    exported from phpMyAdmin

    CREATE TABLE `setting` (
    `setting_id` tinyint(3) unsigned NOT NULL auto_increment,
    `title` varchar(200) NOT NULL default '',
    `uri` varchar(200) NOT NULL default '',
    `newscount` tinyint(3) unsigned NOT NULL default '0',
    `timezone` tinyint(4) NOT NULL default '0',
    `articlecount` tinyint(3) unsigned NOT NULL default '0',
    `showlength` smallint(5) unsigned NOT NULL default '0',
    `absolutepath` varchar(250) NOT NULL default '',
    PRIMARY KEY (`setting_id`)
    ) TYPE=MyISAM AUTO_INCREMENT=2 ;

  4. #4
    SitePoint Guru MikeBigg's Avatar
    Join Date
    Jun 2004
    Location
    Reading, UK
    Posts
    970
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm. Still can't see it, but then it is 3:30am

    I must go ... good luck.

    Mike

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    the reason you can't see it, mike, is because it isn't there



    thanks for the CREATE TABLE statement, Atealtha

    i ran it, then i added a few rows, then i ran your UPDATE and it worked fine

    where did you get the UPDATE statement from? it looks cut-n-pasted

    there's gotta be something else in the sql that's not showing up here

    the UPDATE statement as shown is fine
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •