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 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2008
    Posts
    25
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Problem with creating a TABLE with BOOL data type

    I keep getting a error on line 13.

    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 '' at line 13
    Here's my mySql code

    Code:
    $mysql->query("CREATE TABLE admissionData (
    reservationNum INT(6) NOT NULL AUTO_INCREMENT,
    guestNum INT(7) NOT NULL PRIMARY KEY AUTO_INCREMENT,
    firstName VARCHAR(30) NOT NULL,
    mI VARCHAR(1),
    lastName VARCHAR(30) NOT NULL,
    creditCard BIGINT(16),
    cellNumber BIGINT(10),
    homeNumber BIGINT(10),
    workNumber BIGINT(10),
    numOfDays SMALLINT(3),
    charge FLOAT(6,2),
    canceled BOOL") or die($mysql->error);
    What am I doing wrong?

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by knight fyre View Post
    I keep getting a error on line 13.



    Here's my mySql code

    Code:
    $mysql->query("CREATE TABLE admissionData (
    reservationNum INT(6) NOT NULL AUTO_INCREMENT,
    guestNum INT(7) NOT NULL PRIMARY KEY AUTO_INCREMENT,
    firstName VARCHAR(30) NOT NULL,
    mI VARCHAR(1),
    lastName VARCHAR(30) NOT NULL,
    creditCard BIGINT(16),
    cellNumber BIGINT(10),
    homeNumber BIGINT(10),
    workNumber BIGINT(10),
    numOfDays SMALLINT(3),
    charge FLOAT(6,2),
    canceled BOOL)") or die($mysql->error);
    What am I doing wrong?
    at first look you miss a ')'.

    best regards

  • Users who have thanked oesxyl for this post:

    knight fyre (04-28-2009)

  • #3
    New Coder
    Join Date
    Mar 2008
    Posts
    25
    Thanks
    8
    Thanked 0 Times in 0 Posts
    I knew it was something simple.


  •  

    Tags for this Thread

    Posting Permissions

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