Professional Web Applications Themes

mysql problem - MySQL

Hi, I have what I imagine to be a very simple problem while importing an sql file into my database. the error that shows up is this: MySQL said: #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 'SELECT configuration_group_id FROM configuration_group WHERE co here is what it is trying to process: INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` ) VALUES ( '', 'Number ...

  1. #1

    Default mysql problem

    Hi, I have what I imagine to be a very simple problem while importing an sql
    file into my database. the error that shows up is this:

    MySQL said:

    #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
    'SELECT configuration_group_id FROM configuration_group WHERE co




    here is what it is trying to process:



    INSERT INTO `configuration` ( `configuration_id` , `configuration_title` ,
    `configuration_key` , `configuration_value` , `configuration_description` ,
    `configuration_group_id` , `sort_order` , `last_modified` , `date_added` ,
    `use_function` , `set_function` )
    VALUES (
    '', 'Number Of Prices Per Products', 'XPRICES_NUM', '1', 'Number of prices
    per products<br><br><b>WARNING: Changing this value will delete prices entry
    in products table!</b><br><br><b>Every groups that use a deleted price will
    use product default price.</b>', (

    SELECT configuration_group_id
    FROM configuration_group
    WHERE configuration_group_title = 'TotalB2B'
    ), '31', '2003-11-11 18:33:04', '0000-00-00 00:00:00', 'tep_update_prices',
    'tep_cfg_pull_down_prices('
    ), (
    '', 'Allow Guest To See Prices', 'ALLOW_GUEST_TO_SEE_PRICES', 'false',
    'Allow guests to view default prices', (

    SELECT configuration_group_id
    FROM configuration_group
    WHERE configuration_group_title = 'TotalB2B'
    ), '32', '', '2004-03-15 14:59:05', NULL ,
    'tep_cfg_select_option(array(\'true\', \'false\'),'
    ), (
    '', 'Guest Discount', 'GUEST_DISCOUNT', '0', 'Guest discount', (

    SELECT configuration_group_id
    FROM configuration_group
    WHERE configuration_group_title = 'TotalB2B'
    ), '33', '', '2004-03-15 14:59:05', NULL , ''
    ), (
    '', 'Special price (products price hiding)', 'SPECIAL_PRICES_HIDE', 'false',
    'Special price (products price hiding)', (

    SELECT configuration_group_id
    FROM configuration_group
    WHERE configuration_group_title = 'TotalB2B'
    ), '34', '', '2004-03-15 14:59:05', NULL ,
    'tep_cfg_select_option(array(\'true\', \'false\'),'
    ), (
    '', 'New customer Enable', 'NEW_CUSTOMERS_ENABLED', 'false', 'Enable or
    disable new customers after their registration', (

    SELECT configuration_group_id
    FROM configuration_group
    WHERE configuration_group_title = 'TotalB2B'
    ), '35', '', '2004-03-15 14:59:05', NULL ,
    'tep_cfg_select_option(array(\'true\', \'false\'),'
    );



    could anybody point me in the right direction? Unfortunately, I can't seem
    to find the version of MySQl my host is using (dotster.com)...

    Thanks for any help. I also apologize if this is the wrong forum for this
    type of question.





    --------------------------------------------------------------------------------





    edgy Guest

  2. #2

    Default Re: mysql problem

    edgy wrote: 
    <snip>

    The version of MySQL is quite important here. What does phpinfo() show
    you?

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  3. #3

    Default Re: mysql problem


    "Jerry Stuckle" <net> wrote in message
    news:com... 
    > <snip>
    >
    > The version of MySQL is quite important here. What does phpinfo() show
    > you?
    >[/ref]

    Hi Jerry,
    ok, I asked the customer support and they gave me this info:
    mysqld Ver 4.0.18-standard
    phpMyAdmin 2.8.0.4

    Thanks for taking the time!


    edgy Guest

  4. #4

    Default Re: mysql problem

    edgy wrote: 
    >>
    >><snip>
    >>
    >>The version of MySQL is quite important here. What does phpinfo() show
    >>you?
    >>[/ref]
    >
    >
    > Hi Jerry,
    > ok, I asked the customer support and they gave me this info:
    > mysqld Ver 4.0.18-standard
    > phpMyAdmin 2.8.0.4
    >
    > Thanks for taking the time!
    >
    >[/ref]

    That makes it simple. Subselects aren't supported before MySQL 4.1.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  5. #5

    Default Re: mysql problem


    "Jerry Stuckle" <net> wrote in message
    news:com... 
    >>
    >>
    >> Hi Jerry,
    >> ok, I asked the customer support and they gave me this info:
    >> mysqld Ver 4.0.18-standard
    >> phpMyAdmin 2.8.0.4
    >>
    >> Thanks for taking the time!
    >>
    >>[/ref]
    >
    > That makes it simple. Subselects aren't supported before MySQL 4.1.
    >
    > --[/ref]
    ok, I see.. any hints on rewriting this?


    edgy Guest

  6. #6

    Default Re: mysql problem

    edgy wrote: 
    >>
    >>That makes it simple. Subselects aren't supported before MySQL 4.1.
    >>
    >>--[/ref]
    >
    > ok, I see.. any hints on rewriting this?
    >
    >[/ref]

    Edgy,

    Hmmm, I think I ed up. You're doing an INSERT, not a SELECT, and
    the SELECT should be valid.

    I'm not sure about your use of parens, though - I think you may have
    some balancing problems. Maybe something more like: (reformatted a
    little to better suit my liking :-) )

    Basically I took the parens out from around your SELECT statements
    (they're not needed) and tried to ensure they were balanced around your
    values - one set of parens around each set of values, and one set around
    all the values.

    Not having your database schema I can't test it, but something like this
    should be close.

    One other thing - can you get it to work with one set of values (instead
    of 4)? When having trouble like this I generally get a single set
    working then add the others later.


    INSERT INTO `configuration`
    (`configuration_id` ,
    `configuration_title` ,
    `configuration_key` ,
    `configuration_value` ,
    `configuration_description` ,
    `configuration_group_id` ,
    `sort_order` ,
    `last_modified` ,
    `date_added` ,
    `use_function` ,
    `set_function` )
    VALUES (
    (
    '',
    'Number Of Prices Per Products',
    'XPRICES_NUM', '1',
    'Number of prices per products<br><br><b>WARNING: Changing this
    value will delete prices entry in products table!</b><br><br><b>Every
    groups that use a deleted price will use product default price.</b>',
    SELECT configuration_group_id
    FROM configuration_group
    WHERE configuration_group_title = 'TotalB2B' ,
    '31',
    '2003-11-11 18:33:04',
    '0000-00-00 00:00:00',
    'tep_update_prices',
    'tep_cfg_pull_down_prices('
    ),
    (
    '',
    'Allow Guest To See Prices',
    'ALLOW_GUEST_TO_SEE_PRICES',
    'false',
    'Allow guests to view default prices',
    SELECT configuration_group_id
    FROM configuration_group
    WHERE configuration_group_title = 'TotalB2B',
    '32',
    '',
    '2004-03-15 14:59:05',
    NULL ,
    'tep_cfg_select_option(array(\'true\', \'false\'),'
    ),
    (
    '',
    'Guest Discount',
    'GUEST_DISCOUNT',
    '0',
    'Guest discount',
    SELECT configuration_group_id
    FROM configuration_group
    WHERE configuration_group_title = 'TotalB2B',
    '33',
    '',
    '2004-03-15 14:59:05',
    NULL ,
    ''
    ),
    (
    '',
    'Special price (products price hiding)',
    'SPECIAL_PRICES_HIDE',
    'false',
    'Special price (products price hiding)',
    SELECT configuration_group_id
    FROM configuration_group
    WHERE configuration_group_title = 'TotalB2B',
    '34',
    '',
    '2004-03-15 14:59:05',
    NULL ,
    'tep_cfg_select_option(array(\'true\', \'false\'),'
    ),
    (
    '',
    'New customer Enable',
    'NEW_CUSTOMERS_ENABLED',
    'false',
    'Enable or disable new customers after their registration',
    SELECT configuration_group_id
    FROM configuration_group
    WHERE configuration_group_title = 'TotalB2B',
    '35',
    '',
    '2004-03-15 14:59:05',
    NULL ,
    'tep_cfg_select_option(array(\'true\', \'false\'),'
    ));

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  7. #7

    Default Re: mysql problem


    "Jerry Stuckle" <net> wrote in message
    news:com... 
    >>
    >> ok, I see.. any hints on rewriting this?[/ref]
    >
    > Edgy,
    >
    > Hmmm, I think I ed up. You're doing an INSERT, not a SELECT, and the
    > SELECT should be valid.
    >
    > I'm not sure about your use of parens, though - I think you may have some
    > balancing problems. Maybe something more like: (reformatted a little to
    > better suit my liking :-) )
    >
    > Basically I took the parens out from around your SELECT statements
    > (they're not needed) and tried to ensure they were balanced around your
    > values - one set of parens around each set of values, and one set around
    > all the values.
    >
    > Not having your database schema I can't test it, but something like this
    > should be close.
    >
    > One other thing - can you get it to work with one set of values (instead
    > of 4)? When having trouble like this I generally get a single set working
    > then add the others later.
    >
    >[/ref]
    <snip>

    Hi Jerry,

    thanks for your help, but I still couldn't get past the syntax errors, and
    Irealize I have absolutely no chance of figuring this out without spending a
    few days reading the manual, so I was able to get something else that
    hopefully solved the issue I was having with my database.

    Thanks for your help though...it seems like an interesing language to study
    at some point.


    edgy Guest

Similar Threads

  1. Problem with MySQL (??)
    By Leszek in forum MySQL
    Replies: 1
    Last Post: June 19th, 03:28 PM
  2. Replies: 0
    Last Post: January 29th, 02:03 PM
  3. Replies: 2
    Last Post: July 2nd, 09:21 PM
  4. Replies: 3
    Last Post: October 28th, 05:28 PM
  5. PHP and MySQL problem
    By David in forum PHP Development
    Replies: 1
    Last Post: September 18th, 10:51 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139