![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| 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. -------------------------------------------------------------------------------- | |||
| Advertisements |
| | #2 | ||
| edgy wrote: > 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 > <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. jstucklex@attglobal.net ================== | |||
| | #3 | ||
| "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message news:XqOdnYMQrPgG7djYnZ2dnUVZ_u-dnZ2d@comcast.com... > edgy wrote: >> 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 >> > <snip> > > The version of MySQL is quite important here. What does phpinfo() show > you? > 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! | |||
| | #4 | ||
| edgy wrote: > "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message > news:XqOdnYMQrPgG7djYnZ2dnUVZ_u-dnZ2d@comcast.com... > >>edgy wrote: >> >>>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 >>> >> >><snip> >> >>The version of MySQL is quite important here. What does phpinfo() show >>you? >> > > > 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! > > 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. jstucklex@attglobal.net ================== | |||
| | #5 | ||
| "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message news:H_2dnU6X4pvGd9jYnZ2dnUVZ_rednZ2d@comcast.com. .. > edgy wrote: >> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message >> news:XqOdnYMQrPgG7djYnZ2dnUVZ_u-dnZ2d@comcast.com... >> >>>edgy wrote: >>> >>>>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 >>>> >>> >>><snip> >>> >>>The version of MySQL is quite important here. What does phpinfo() show >>>you? >>> >> >> >> 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! >> >> > > That makes it simple. Subselects aren't supported before MySQL 4.1. > > -- ok, I see.. any hints on rewriting this? | |||
| | #6 | ||
| edgy wrote: > "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message > news:H_2dnU6X4pvGd9jYnZ2dnUVZ_rednZ2d@comcast.com. .. > >>edgy wrote: >> >>>"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message >>>news:XqOdnYMQrPgG7djYnZ2dnUVZ_u-dnZ2d@comcast.com... >>> >>> >>>>edgy wrote: >>>> >>>> >>>>>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 >>>>> >>>> >>>><snip> >>>> >>>>The version of MySQL is quite important here. What does phpinfo() show >>>>you? >>>> >>> >>> >>>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! >>> >>> >> >>That makes it simple. Subselects aren't supported before MySQL 4.1. >> >>-- > > ok, I see.. any hints on rewriting this? > > Edgy, Hmmm, I think I screwed 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. jstucklex@attglobal.net ================== | |||
| | #7 | ||
| "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message news:c-adnQ65gb_-PtvYnZ2dnUVZ_oCdnZ2d@comcast.com... > edgy wrote: >> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message >> news:H_2dnU6X4pvGd9jYnZ2dnUVZ_rednZ2d@comcast.com. .. >> >>>edgy wrote: >>> >>>>"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message >>>>news:XqOdnYMQrPgG7djYnZ2dnUVZ_u-dnZ2d@comcast.com... >>>> >>>> >>>>>edgy wrote: >>>>> >>>>> >>>>>>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 >>>>>> >>>>> >>>>><snip> >>>>> >>>>>The version of MySQL is quite important here. What does phpinfo() >>>>>show you? >>>>> >>>> >>>> >>>>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! >>>> >>>> >>> >>>That makes it simple. Subselects aren't supported before MySQL 4.1. >>> >>>-- >> >> ok, I see.. any hints on rewriting this? > > Edgy, > > Hmmm, I think I screwed 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. > > <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. | |||
| Featured Websites | ||||
|
![]() |
| Tags: mysql, problem |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MySQL and Apache problem | Paul Morrison | Database | 2 | 06-10-2007 12:19 AM |
| problem with mysql.sock | Ben | Database | 2 | 05-31-2007 8:49 PM |
| Problem character set utf8 in Mysql 4.1.9-nt and ASP (v3). | Yan | Database | 3 | 05-31-2007 8:49 PM |
| Problem with MySQL and ODBC | André | Database | 2 | 05-31-2007 8:46 PM |
| Featured Websites | ||||
|