Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,042
    Thanks
    19
    Thanked 42 Times in 42 Posts

    mysql_query() gone wrong

    PHP Code:
    mysql_query(CREATE TABLE `airport` (
      `
    idint(11NOT NULL auto_increment,
      `
    ownervarchar(40NOT NULL default '',
      `
    locationenum('England','China','France','Holland','USA','Germany','Canada','South Africa'NOT NULL default 'England',
      `
    travel_pricesvarchar(100NOT NULL default '100-100-100-100-100-100-100-100',
      `
    profitvarchar(100NOT NULL default '0-0-0-0-0-0-0-0',
      
    PRIMARY KEY  (`id`),
      
    KEY `id` (`id`)
    ENGINE=MyISAM DEFAULT CHARSET=latin1); 
    is throwing an error
    Parse error: parse error, unexpected T_STRING in /home/www/jamwes6.freehostia.com/123.php on line 3

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Looks like the closing bracket here to me

    ENGINE=MyISAM DEFAULT CHARSET=latin1);

  • #3
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,042
    Thanks
    19
    Thanked 42 Times in 42 Posts
    what about it? lol should be there shouldnt it

  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Doh, I see what you've done. You've not put the query in quotes. I thought you was just posting the sql

    PHP Code:
    mysql_query("CREATE TABLE `airport` (
      `id` int(11) NOT NULL auto_increment,
      `owner` varchar(40) NOT NULL default '',
      `location` enum('England','China','France','Holland','USA','Germany','Canada','South Africa') NOT NULL default 'England',
      `travel_prices` varchar(100) NOT NULL default '100-100-100-100-100-100-100-100',
      `profit` varchar(100) NOT NULL default '0-0-0-0-0-0-0-0',
      PRIMARY KEY  (`id`),
      KEY `id` (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1"
    ); 

  • Users who have thanked Nightfire for this post:

    rafiki (08-23-2007)

  • #5
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,042
    Thanks
    19
    Thanked 42 Times in 42 Posts
    doh shoulda caught it
    thanks


  •  

    Posting Permissions

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