+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Can I get help with this ..

  1. #1
    fierce's Avatar
    fierce is offline x10 Sophmore fierce is an unknown quantity at this point
    Join Date
    Jul 2008
    Location
    Macedonia
    Posts
    222

    Can I get help with this ..

    #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 'num, ticket, cash ) VALUES
    ( 0 , 0 , 100000000), ( 0 , 1 , 100000' at line 1
    http://img61.imageshack.us/my.php?image=mysqlkc0.jpg
    thx in advance
    fierce

  2. #2
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: Can I get help with this ..

    What are you trying to do?
    I'm guessing you should add "INSERT INTO `tablename`" at the start of the database, but I'm not sure, as this 'query' doesn't really mention what he tries to achieve.
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

  3. #3
    scopey is offline x10Hosting Member scopey is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    62

    Re: Can I get help with this ..

    Yeah, the query is missing the whole first line or something. Why are you using the SQL console anyway? phpMyAdmin provides a really nice GUI to your database. Use that to enter values.

    But anyway, you need the INSERT INTO `tablename` on the first line infront of ('num', 'ticket', 'cash')
    - When in doubt, refer to the PHP manual.

  4. #4
    ryanlwh is offline x10Hosting Member ryanlwh is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    4

    Re: Can I get help with this ..

    Well take a closer look at the attachment. He's using phpMyAdmin .

    And as other pointed out, you're just missing INSERT INTO tablename

  5. #5
    scopey is offline x10Hosting Member scopey is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    62

    Re: Can I get help with this ..

    Yes, but he's using the SQL query part of phpMyAdmin... There's a nicer, easier way to enter data into a table.
    - When in doubt, refer to the PHP manual.

  6. #6
    fierce's Avatar
    fierce is offline x10 Sophmore fierce is an unknown quantity at this point
    Join Date
    Jul 2008
    Location
    Macedonia
    Posts
    222

    Re: Can I get help with this ..

    Quote Originally Posted by scopey View Post
    .. There's a nicer, easier way to enter data into a table.
    What's that ?

  7. #7
    sunils's Avatar
    sunils is offline x10 Spammer sunils is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Chennai ,India
    Posts
    2,264

    Re: Can I get help with this ..

    There may be more that one reason for this error coming up...
    (1). since you have specified the column names in the query, check whether you have not missed out any column which is set to not null.
    (2).The second reason could be that the datatype of the column and the datatype of the data does not match. So you need to convert it to the respective format before executing the query..

    since i could not access the image (because of the restriction on our network) can you post the entire query that you are using.
    [LEFT][B]Sunil Sankar
    -------------------------------------------------------------------------

  8. #8
    fierce's Avatar
    fierce is offline x10 Sophmore fierce is an unknown quantity at this point
    Join Date
    Jul 2008
    Location
    Macedonia
    Posts
    222

    Re: Can I get help with this ..

    Quote Originally Posted by sunils View Post
    There may be more that one reason for this error coming up...
    (1). since you have specified the column names in the query, check whether you have not missed out any column which is set to not null.
    (2).The second reason could be that the datatype of the column and the datatype of the data does not match. So you need to convert it to the respective format before executing the query..

    since i could not access the image (because of the restriction on our network) can you post the entire query that you are using.
    i fixed the problem with that..but i can't insert this
    INSERT INTO eras
    ( name , peasants , food , mana , infantry , cavalry , siege , naval , wizards , homes , mines , academies , barracks , mage towers , farms , towers , o_infantry, d_infantry, o_cavalry, d_cavalry, o_siege, d_siege, o_naval, d_naval) VALUES
    ('Dark' ,'Villagers' ,'Grains' ,'Mana' ,'Pikemen' ,'Cavalry' ,'Archers' ,'Galleons' ,'Wizards' ,'Huts' ,'Mines' ,'Academies','Keeps' ,'Mage Towers' ,'Farms' ,'Towers' , 1 , 2 , 3 , 2 , 7 , 5 , 7 , 6 ),
    ('Mystical','Peasants','Grains','Mana' ,'Swordsmen','Heavy Cavalry' ,'Bowmen' ,'Battleships' ,'Sorcerers' ,'Houses','Gold Mines','Military Academies','Keeps','Mage Towers' ,'Plantations' ,'Sentry Towers' , 2 , 1 , 2 , 6 , 5 , 3 , 6 , 8 ),
    ('Imperial' ,'Citizens','Grains','Mana','Long Swordsmen' ,'Cataphract','Crossbowmen','Juggernauts','Spellca sters ','Houses','Gold Mines','Imperial Academies','Keeps','Mage Towers','Imperial Plantations','Guard Towers', 1 , 2 , 5 , 2 , 6 , 3 , 7 , 7 );

    http://img78.imageshack.us/img78/1299/mysql1sw5.jpg
    Last edited by fierce; 09-02-2008 at 10:47 AM.

  9. #9
    woiwky is offline x10 Lieutenant woiwky is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    390

    Re: Can I get help with this ..

    The problem is the 'mage towers' part. You can't have spaces in field names. Perhaps you meant mage_towers instead?
    "But you have access to the greatest source of knowledge in the universe."
    "Well I do talk to myself sometimes, yes."

    "I'm back, and I'm bad! Obviously within certain, sensible, preset parameters"

  10. #10
    scopey is offline x10Hosting Member scopey is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    62

    Re: Can I get help with this ..

    Quote Originally Posted by fierce View Post
    What's that ?
    Hit the insert tab at the top of the page
    - When in doubt, refer to the PHP manual.

+ Reply to Thread
Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers