1064 - You have an error in your SQL syntax
#321
Posted 15 November 2009, 23:54
I installed a contribution "Product Lead Time" by modifying the required files by adding only the needed language. I also ran the followng SQL query
ALTER TABLE `products` ADD `products_lead_time` INT NOT NULL DEFAULT '0';
Before running the query I backed up my database.
I receved a syntax error:
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 'p, products_description pd where p.products_id = '328' and p.products_id = pd.pr' at line 1
I could not determine how to remedy this problem so I restored my files back to the way they were. Now I am still getting a syntax error as follows:
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 'p, products_description pd where p.products_id = '328' and p.products_id = pd.pr' at line 1
select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, products_length, products_width, products_height, products_ready_to_ship, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id fromproducts p, products_description pd where p.products_id = '328' and p.products_id = pd.products_id and pd.language_id = '1'
I am out of options as I have examined my files closely and they are back to the status they were in before I ran the SQL query and changed the files. I have also conducted a restore on my database.
Any help will be appreciated. My store address is www.americanfhb.com
You can email me if needed at tgriffithjr@charter.net
Thanks
#322
Posted 16 November 2009, 00:56
Still trying to figure it out. Any ideas from anyone?
ChiefTom500, on 15 November 2009, 23:54, said:
I installed a contribution "Product Lead Time" by modifying the required files by adding only the needed language. I also ran the followng SQL query
ALTER TABLE `products` ADD `products_lead_time` INT NOT NULL DEFAULT '0';
Before running the query I backed up my database.
I receved a syntax error:
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 'p, products_description pd where p.products_id = '328' and p.products_id = pd.pr' at line 1
I could not determine how to remedy this problem so I restored my files back to the way they were. Now I am still getting a syntax error as follows:
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 'p, products_description pd where p.products_id = '328' and p.products_id = pd.pr' at line 1
select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, products_length, products_width, products_height, products_ready_to_ship, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id fromproducts p, products_description pd where p.products_id = '328' and p.products_id = pd.products_id and pd.language_id = '1'
I am out of options as I have examined my files closely and they are back to the status they were in before I ran the SQL query and changed the files. I have also conducted a restore on my database.
Any help will be appreciated. My store address is www.americanfhb.com
You can email me if needed at tgriffithjr@charter.net
Thanks
#323
Posted 16 November 2009, 01:20
ChiefTom500, on 16 November 2009, 00:56, said:
Still trying to figure it out. Any ideas from anyone?
#324
Posted 17 November 2009, 03:30
Para mi la solucion a ese error fue editar la base de datos en mysql.
1. Entre a "mysql" mediante "phpadmin"
2. Click en "manufacturers"
3. Click en el tab que dise "insert"
4. En "manufacturers_id" puse (1) y en "manufacturers_name" puse una letra (a)
5. y eso fue todo... luego fui al panel de administracion de oscommerce y edite la informacion del manufacturero.
Esto tambien funciona si usted borro todas las categorias en el panel de administracion de oscommerce y le sale este error. (1064 - You have an error in your SQL syntax). Añadir valor en la base de datos produce que oscommerce pueda leer de la base de datos y no produsca un error.
(editar el .php puede producir una inestabilidad en su pagina).
(http://www.internetnets.com)
webmaster
#325
Posted 05 January 2010, 13:19
ChiefTom500, on 16 November 2009, 01:20, said:
In your sql above that is throwing the error, I see this word: fromproducts
php really *needs* the whitespace there...
#326
Posted 18 January 2010, 19:34
I'm having this error only with one page checkout when a returning customer logs in and tries to buy something.
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 'where customer_id = '3'' at line 1
select amount from where customer_id = '3'
Sorry to double post but I haven't seen anyone with this exact problem anywhere and it appears to be some database issue outside the scope of that forum. I'm using mySQL 5.1.30 and the split page results fix at the beginning of this forum has already been applied. I triple checked the installation of one page checkout I did. Could this be some strange conflict with purchase without account even though they're supposed to work together? Any ideas would be much appreciated.
Thanks,
Nick
#327
Posted 19 January 2010, 07:37
longhorn1999, on 18 January 2010, 19:34, said:
I'm having this error only with one page checkout when a returning customer logs in and tries to buy something.
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 'where customer_id = '3'' at line 1
select amount from where customer_id = '3'
Sorry to double post but I haven't seen anyone with this exact problem anywhere and it appears to be some database issue outside the scope of that forum. I'm using mySQL 5.1.30 and the split page results fix at the beginning of this forum has already been applied. I triple checked the installation of one page checkout I did. Could this be some strange conflict with purchase without account even though they're supposed to work together? Any ideas would be much appreciated.
Thanks,
Nick
http://forums.oscommerce.com/topic/333292-one-page-checkout-support/page__st__1100__gopid__1476227&#entry1476227
got a solution to my problem...no database problem...just some extra junk code gumming things up.
#328
Posted 29 March 2010, 07:55
This is on the catalog side on page one of one of my categories. The rest of the pages seem fine.
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 '' at line 1<br><br>select filter from products where products_id = ;<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>
Can anyone help figure out what this is about? Thanks.
#329
Posted 20 April 2010, 17:16
This is happening only on products with attributes and it happens regardless of which attribute is chosen.
The error is:
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 '{1}7' at line 1
SELECT products_master FROM products WHERE products_id = 128{1}7
[TEP STOP]
The query code is:
// Master Products
$master_prod = tep_db_query("select products_master, products_master_status from " . TABLE_PRODUCTS . " where products_id = '" . $products[$i]['id'] . "'");
$master_prod_values = tep_db_fetch_array($master_prod);
if (($master_prod_values['products_master_status'] == 0) && ($master_prod_values['products_master'] != 0)) {
$prod_link_id = $master_prod_values['products_master'];
} else { $prod_link_id = $products[$i]['id']; }
$products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
' <tr>' .
' <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $prod_link_id) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
' <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>';
//Master Products EOF
I did try changing
where products_id = '" . $products[$i]['id'] . "'to
where products_id = '" . (int)$products[$i]['id'] . "'but it did not make a difference.
I also tried the suggestion at the beginning of this forum to change admin/includes/classes/split_page_results.php by adding this blurb
if ($offset < 0)
{
$offset = 0 ;
}
again - this didn't do anything for my issue.
Anyone have any ideas how to fix this? I've been searching the forums and haven't found this particular error anywhere else yet. Thanks in advance for any ideas
Currently using: STS v4.5.8 with Header Tags Controller v2.6.3, Master Products v1.2, Separate Pricing Per Customer v 4.1.5, Hide Products and Categories from Customer Groups for SPPC , InfoBox Customizer, Discount Coupon Codes and Exclude Customer Groups for DCC, All Products, Tell Friend About Site too, Scrolling Specials Box, Ultimate SEO URL's, MS2-2.2 SiteMap, Product Sort, Customer Testimonials, Embed Links w/SID in Description, Minimum Order Amount, Free Shipping w/Minimum Amount, Cross Sell for MS2, Super Contact Us Enhancement + antirobot, Anti Robot Registration Validation, Agree2Terms, Customer Registration Report, Sales Report 2, Edit Auto Emails in Admin, Ad Tracker, Visitor Web Stats, Supertracker, Product Listing, Sales Tracker, How Did You Hear About Us, Order Editor, About Us, Country State Selector, Credit Card Number Encryption, Remove Credit Card Numbers, Links Manager II and Google Analytics
#330
Posted 20 April 2010, 17:18
Currently using: STS v4.5.8 with Header Tags Controller v2.6.3, Master Products v1.2, Separate Pricing Per Customer v 4.1.5, Hide Products and Categories from Customer Groups for SPPC , InfoBox Customizer, Discount Coupon Codes and Exclude Customer Groups for DCC, All Products, Tell Friend About Site too, Scrolling Specials Box, Ultimate SEO URL's, MS2-2.2 SiteMap, Product Sort, Customer Testimonials, Embed Links w/SID in Description, Minimum Order Amount, Free Shipping w/Minimum Amount, Cross Sell for MS2, Super Contact Us Enhancement + antirobot, Anti Robot Registration Validation, Agree2Terms, Customer Registration Report, Sales Report 2, Edit Auto Emails in Admin, Ad Tracker, Visitor Web Stats, Supertracker, Product Listing, Sales Tracker, How Did You Hear About Us, Order Editor, About Us, Country State Selector, Credit Card Number Encryption, Remove Credit Card Numbers, Links Manager II and Google Analytics
#331
Posted 20 April 2010, 17:21
crust, on 29 March 2010, 07:55, said:
This is on the catalog side on page one of one of my categories. The rest of the pages seem fine.
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 '' at line 1<br><br>select filter from products where products_id = ;<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>
Can anyone help figure out what this is about? Thanks.
Currently using: STS v4.5.8 with Header Tags Controller v2.6.3, Master Products v1.2, Separate Pricing Per Customer v 4.1.5, Hide Products and Categories from Customer Groups for SPPC , InfoBox Customizer, Discount Coupon Codes and Exclude Customer Groups for DCC, All Products, Tell Friend About Site too, Scrolling Specials Box, Ultimate SEO URL's, MS2-2.2 SiteMap, Product Sort, Customer Testimonials, Embed Links w/SID in Description, Minimum Order Amount, Free Shipping w/Minimum Amount, Cross Sell for MS2, Super Contact Us Enhancement + antirobot, Anti Robot Registration Validation, Agree2Terms, Customer Registration Report, Sales Report 2, Edit Auto Emails in Admin, Ad Tracker, Visitor Web Stats, Supertracker, Product Listing, Sales Tracker, How Did You Hear About Us, Order Editor, About Us, Country State Selector, Credit Card Number Encryption, Remove Credit Card Numbers, Links Manager II and Google Analytics
#332
Posted 21 April 2010, 19:56
// customer adds a product from the products page
case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+ $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id']);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
//Master Products
// customer adds multiple products from the master_listing page
case 'add_slave' :
reset($HTTP_POST_VARS);
while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) {
if (substr($key,0,11) == "Qty_ProdId_") {
$prodId = substr($key,11);
$qty = $val;
// if zero: go to the next HTTP_POST_VARS on next line
if ($qty <= 0) continue;
if(isset($HTTP_POST_VARS["id_$prodId"]) && is_array($HTTP_POST_VARS["id_$prodId"])) {
// We have attributes
$cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId,$HTTP_POST_VARS["id_$prodId"]))+$qty, $HTTP_POST_VARS["id_$prodId"]);
} else {
// No attributes
$cart->add_cart($prodId, $cart->get_quantity($prodId)+$qty);
}
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
//Master Products EOF
// performed by the 'buy now' button in product listings and review page
case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {
if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
} else {
$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
case 'notify' : if (tep_session_is_registered('customer_id')) {
if (isset($HTTP_GET_VARS['products_id'])) {
$notify = $HTTP_GET_VARS['products_id'];
} elseif (isset($HTTP_GET_VARS['notify'])) {
$notify = $HTTP_GET_VARS['notify'];
} elseif (isset($HTTP_POST_VARS['notify'])) {
$notify = $HTTP_POST_VARS['notify'];
} else {
tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
}
if (!is_array($notify)) $notify = array($notify);
for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'");
$check = tep_db_fetch_array($check_query);
// BOF SPPC, Hide products and categories from groups
if (is_array($hide_status_products) && tep_not_null($hide_status_products)) {
foreach($hide_status_products as $key => $subarray) {
if ($subarray['products_id'] == tep_get_prid($notify[$i]) && $subarray['hidden'] == '0') {
if ($check['count'] < 1) {
tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");
}
} // end if ($subarray['products_id'] == tep_get_prid($notify[$i])...
} // end foreach ($hide_status_products as $key => $subarray)
} else {
if ($check['count'] < 1) {
tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");
}
}
// EOF SPPC, Hide products and categories from groups
}
tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
} else {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
break;
case 'notify_remove' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) {
$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
$check = tep_db_fetch_array($check_query);
if ($check['count'] > 0) {
tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
}
tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))));
} else {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
break;
case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {
if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid']));
} else {
$cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
} // end switch
// BOF Separate Pricing Per Customer v4.1, Hide products from groups mod
} else { // $hide_product is true
tep_redirect(tep_href_link(FILENAME_DEFAULT));
}
// EOF Separate Pricing Per Customer v4.1, Hide products from groups mod
} // if (isset($HTTP_GET_VARS['action']))
Does anything in there look to you like it would be the culprit?
TracyS, on 20 April 2010, 17:16, said:
This is happening only on products with attributes and it happens regardless of which attribute is chosen.
The error is:
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 '{1}7' at line 1
SELECT products_master FROM products WHERE products_id = 128{1}7
[TEP STOP]
Currently using: STS v4.5.8 with Header Tags Controller v2.6.3, Master Products v1.2, Separate Pricing Per Customer v 4.1.5, Hide Products and Categories from Customer Groups for SPPC , InfoBox Customizer, Discount Coupon Codes and Exclude Customer Groups for DCC, All Products, Tell Friend About Site too, Scrolling Specials Box, Ultimate SEO URL's, MS2-2.2 SiteMap, Product Sort, Customer Testimonials, Embed Links w/SID in Description, Minimum Order Amount, Free Shipping w/Minimum Amount, Cross Sell for MS2, Super Contact Us Enhancement + antirobot, Anti Robot Registration Validation, Agree2Terms, Customer Registration Report, Sales Report 2, Edit Auto Emails in Admin, Ad Tracker, Visitor Web Stats, Supertracker, Product Listing, Sales Tracker, How Did You Hear About Us, Order Editor, About Us, Country State Selector, Credit Card Number Encryption, Remove Credit Card Numbers, Links Manager II and Google Analytics
#333
Posted 26 April 2010, 17:14
You can see this in action at mountainmeadowherbs.com/gentle-birth-formula-p-31.html - try adding it to the cart and you'll see the error.
TracyS, on 21 April 2010, 19:56, said:
// customer adds a product from the products page
case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+ $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id']);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
//Master Products
// customer adds multiple products from the master_listing page
case 'add_slave' :
reset($HTTP_POST_VARS);
while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) {
if (substr($key,0,11) == "Qty_ProdId_") {
$prodId = substr($key,11);
$qty = $val;
// if zero: go to the next HTTP_POST_VARS on next line
if ($qty <= 0) continue;
if(isset($HTTP_POST_VARS["id_$prodId"]) && is_array($HTTP_POST_VARS["id_$prodId"])) {
// We have attributes
$cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId,$HTTP_POST_VARS["id_$prodId"]))+$qty, $HTTP_POST_VARS["id_$prodId"]);
} else {
// No attributes
$cart->add_cart($prodId, $cart->get_quantity($prodId)+$qty);
}
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
//Master Products EOF
// performed by the 'buy now' button in product listings and review page
case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {
if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
} else {
$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
case 'notify' : if (tep_session_is_registered('customer_id')) {
if (isset($HTTP_GET_VARS['products_id'])) {
$notify = $HTTP_GET_VARS['products_id'];
} elseif (isset($HTTP_GET_VARS['notify'])) {
$notify = $HTTP_GET_VARS['notify'];
} elseif (isset($HTTP_POST_VARS['notify'])) {
$notify = $HTTP_POST_VARS['notify'];
} else {
tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
}
if (!is_array($notify)) $notify = array($notify);
for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'");
$check = tep_db_fetch_array($check_query);
// BOF SPPC, Hide products and categories from groups
if (is_array($hide_status_products) && tep_not_null($hide_status_products)) {
foreach($hide_status_products as $key => $subarray) {
if ($subarray['products_id'] == tep_get_prid($notify[$i]) && $subarray['hidden'] == '0') {
if ($check['count'] < 1) {
tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");
}
} // end if ($subarray['products_id'] == tep_get_prid($notify[$i])...
} // end foreach ($hide_status_products as $key => $subarray)
} else {
if ($check['count'] < 1) {
tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");
}
}
// EOF SPPC, Hide products and categories from groups
}
tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
} else {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
break;
case 'notify_remove' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) {
$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
$check = tep_db_fetch_array($check_query);
if ($check['count'] > 0) {
tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
}
tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))));
} else {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
break;
case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {
if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid']));
} else {
$cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
} // end switch
// BOF Separate Pricing Per Customer v4.1, Hide products from groups mod
} else { // $hide_product is true
tep_redirect(tep_href_link(FILENAME_DEFAULT));
}
// EOF Separate Pricing Per Customer v4.1, Hide products from groups mod
} // if (isset($HTTP_GET_VARS['action']))
Does anything in there look to you like it would be the culprit?
Currently using: STS v4.5.8 with Header Tags Controller v2.6.3, Master Products v1.2, Separate Pricing Per Customer v 4.1.5, Hide Products and Categories from Customer Groups for SPPC , InfoBox Customizer, Discount Coupon Codes and Exclude Customer Groups for DCC, All Products, Tell Friend About Site too, Scrolling Specials Box, Ultimate SEO URL's, MS2-2.2 SiteMap, Product Sort, Customer Testimonials, Embed Links w/SID in Description, Minimum Order Amount, Free Shipping w/Minimum Amount, Cross Sell for MS2, Super Contact Us Enhancement + antirobot, Anti Robot Registration Validation, Agree2Terms, Customer Registration Report, Sales Report 2, Edit Auto Emails in Admin, Ad Tracker, Visitor Web Stats, Supertracker, Product Listing, Sales Tracker, How Did You Hear About Us, Order Editor, About Us, Country State Selector, Credit Card Number Encryption, Remove Credit Card Numbers, Links Manager II and Google Analytics
#335
Posted 27 April 2010, 14:48
burt, on 27 April 2010, 07:53, said:
You need to strip the attributes from the product ID.
I even gave you the right code to search the forum for.
Currently using: STS v4.5.8 with Header Tags Controller v2.6.3, Master Products v1.2, Separate Pricing Per Customer v 4.1.5, Hide Products and Categories from Customer Groups for SPPC , InfoBox Customizer, Discount Coupon Codes and Exclude Customer Groups for DCC, All Products, Tell Friend About Site too, Scrolling Specials Box, Ultimate SEO URL's, MS2-2.2 SiteMap, Product Sort, Customer Testimonials, Embed Links w/SID in Description, Minimum Order Amount, Free Shipping w/Minimum Amount, Cross Sell for MS2, Super Contact Us Enhancement + antirobot, Anti Robot Registration Validation, Agree2Terms, Customer Registration Report, Sales Report 2, Edit Auto Emails in Admin, Ad Tracker, Visitor Web Stats, Supertracker, Product Listing, Sales Tracker, How Did You Hear About Us, Order Editor, About Us, Country State Selector, Credit Card Number Encryption, Remove Credit Card Numbers, Links Manager II and Google Analytics
#336
Posted 29 April 2010, 14:26
I could fix the 1064 error !!
Edited by webmasterd, 29 April 2010, 14:28.
#337
Posted 29 April 2010, 15:08
webmasterd, on 29 April 2010, 14:26, said:
I could fix the 1064 error !!
Currently using: STS v4.5.8 with Header Tags Controller v2.6.3, Master Products v1.2, Separate Pricing Per Customer v 4.1.5, Hide Products and Categories from Customer Groups for SPPC , InfoBox Customizer, Discount Coupon Codes and Exclude Customer Groups for DCC, All Products, Tell Friend About Site too, Scrolling Specials Box, Ultimate SEO URL's, MS2-2.2 SiteMap, Product Sort, Customer Testimonials, Embed Links w/SID in Description, Minimum Order Amount, Free Shipping w/Minimum Amount, Cross Sell for MS2, Super Contact Us Enhancement + antirobot, Anti Robot Registration Validation, Agree2Terms, Customer Registration Report, Sales Report 2, Edit Auto Emails in Admin, Ad Tracker, Visitor Web Stats, Supertracker, Product Listing, Sales Tracker, How Did You Hear About Us, Order Editor, About Us, Country State Selector, Credit Card Number Encryption, Remove Credit Card Numbers, Links Manager II and Google Analytics
#338
Posted 29 April 2010, 19:33
TracyS, on 27 April 2010, 14:48, said:
If you downloaded the source code of your shop most text editors (at least the ones I use and have used) allow you to search for a phrase in a directory and it's subdirectories. It should be simple to find the "SELECT product_master FROM".
#339
Posted 14 May 2010, 08:44
Simplyeasier, on 01 April 2005, 09:10, said:
First off - this fix is actually already recorded in the contributions section and many thanks to those who recorded it - but I don't think it is a contribution - rather a tip - Secondly the same problem has arisen for 4 people in a few days and I dare say it will happen to more as hosts migrate their mySQL databases to version 4.1.xx -
Hence I post here
If you get an error whilst creating \ modifying your database such that thro admin you delete all entries on a particular table you will likely get this message
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 '-20, 20' at line 1
followed by something like
select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from manufacturers order by manufacturers_name limit -20, 20
or
select banners_id, banners_title, banners_image, banners_group, status, expires_date, expires_impressions, date_status_change, date_scheduled, date_added from banners order by banners_title, banners_group limit -20, 20
depending on which table you have deleted all records from.
To fix this
In admin/includes/classes find split_page_results.php and - BACK IT UP then find the lines
$offset = ($max_rows_per_page * ($current_page_number - 1)); $sql_query .= " limit " . $offset . ", " . $max_rows_per_page;
change to
$offset = ($max_rows_per_page * ($current_page_number - 1));
if ($offset < 0)
{
$offset = 0;
}
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;
MySQL 4.1.xx handles negatives correctly (by forcing an error) in the code above unlike earlier versions of MySQL.
Change (catalog/includes/classes/split_page_results.php around line 67) from:
$this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;to:
$this->sql_query .= " limit " . max($offset, 0) . ", " . $this->number_of_rows_per_page;
Both on the catalog side and the admin side changing $offset to max($offset, 0) is the "official" fix.
hth
Charles
Hello All guys
thank you so much after 5 years. i had this problem in 2010 and the solution was in 2005 so thank u so much again Mr Simplyeasier
Regards
#340
Posted 14 May 2010, 14:23
I found the offending query in the cross sell contribution code I have for the shopping cart page - it needed a single quote by the double quote and then it worked. YAY!
As for casting the product id to an integer - is that done by simply putting (int) in front of products_id so the query would have (int)products_id ?
Jan Zonjee, on 29 April 2010, 19:33, said:
If you downloaded the source code of your shop most text editors (at least the ones I use and have used) allow you to search for a phrase in a directory and it's subdirectories. It should be simple to find the "SELECT product_master FROM".
Currently using: STS v4.5.8 with Header Tags Controller v2.6.3, Master Products v1.2, Separate Pricing Per Customer v 4.1.5, Hide Products and Categories from Customer Groups for SPPC , InfoBox Customizer, Discount Coupon Codes and Exclude Customer Groups for DCC, All Products, Tell Friend About Site too, Scrolling Specials Box, Ultimate SEO URL's, MS2-2.2 SiteMap, Product Sort, Customer Testimonials, Embed Links w/SID in Description, Minimum Order Amount, Free Shipping w/Minimum Amount, Cross Sell for MS2, Super Contact Us Enhancement + antirobot, Anti Robot Registration Validation, Agree2Terms, Customer Registration Report, Sales Report 2, Edit Auto Emails in Admin, Ad Tracker, Visitor Web Stats, Supertracker, Product Listing, Sales Tracker, How Did You Hear About Us, Order Editor, About Us, Country State Selector, Credit Card Number Encryption, Remove Credit Card Numbers, Links Manager II and Google Analytics














