PDA

View Full Version : Can someone decipher this?


MerrilyMe
29-08-2007, 08:54 PM
Playmerrily is on OSC Max but i'm getting some annoying bugs in it, which are frustrating because it was a basic install and so i have no idea what to fix because all i did was unpack it.

It has a wishlist and i think that is what is causing this problem. I keep geting this eror message after occasional products if i try to buy them.

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

delete from customers_wishlist WHERE customers_id=4 AND products_id=

Anyone know whati need to do, or failing that, anyone know how to disable the wishlist, which i think is what is causing the issue. I'm not bothered about having it anyway really.

MrTempleDene
29-08-2007, 09:00 PM
might work better if the SQL says

delete customers_wishlist from customers_wishlist etc.

had a similar problem recently myself

then again, if that is the full line the fact nothing is defined after the products_id=

could be the problem as well

Ravenfire
29-08-2007, 09:05 PM
Take a back up of the file first then try this:-

The fix for product_listing_col.php does not fix the SQL error because the problem is actually coming from includes/application_top.php - the database query is wrong. To fix it, change this:

Code:
// performed by the 'buy now' button in product listings and review page
case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {
// BOF: MOD - Wish List 2.3
if (tep_session_is_registered('customer_id')) {
tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$products_id");
tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " WHERE customers_id=$customer_id AND products_id=$products_id");
}
// EOF: MOD - Wish List 2.3


to this:

Code:
case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {
// BOF: MOD - Wish List 2.3
if (tep_session_is_registered('customer_id')) {
tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_VARS['pid'] . "' and customers_id = '" . $customer_id . "'");
// Begin Wish List Code w/Attributes
tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " WHERE customers_id=$customer_id AND products_id='" . $HTTP_GET_VARS['pid']."'");
}
// EOF: MOD - Wish List 2.3

MerrilyMe
29-08-2007, 09:05 PM
[QUOTE=MrTempleDene;537403]might work better if the SQL says

delete customers_wishlist from customers_wishlist etc.

had a similar problem recently myself

then again, if that is the full line the fact nothing is defined after the products_id=

could be the problem as well[/QUOTE

Swoosh.
Trouble is, that makes absolutely no sense to me at all.
It seems to be getting worse now, i dont seem to be able to add anything. I've got no idea what to do about it. WAIL!

MerrilyMe
29-08-2007, 09:10 PM
Take a back up of the file first then try this:-



Lol, thank you. Except, i honestly have no idea what file i need to change. it seems to be on every main page of products that i've got the problem.

Argh.

Sigh.

Ravenfire
29-08-2007, 09:12 PM
Have a look for that code in includes/application_top.php

MerrilyMe
29-08-2007, 09:18 PM
Okay. Will do. thanks :)
Seems a shame to have a new shop no one can buy anything in....

littlesheep
29-08-2007, 09:20 PM
Seems a shame to have a new shop no one can buy anything in....

Generally helps if they can buy - hope you get it fixed soon

Tanya
29-08-2007, 09:23 PM
is the error on the catalog side or the admin side

I had it recently and tried the following fix

edit the following file:
/includes/classes/split_page_results.php

Insert:

if ($offset < 0)
{
$offset = 0 ;
}

Just before this line:
$this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

Tanya
29-08-2007, 09:52 PM
how are you getting on?

MerrilyMe
29-08-2007, 10:00 PM
how are you getting on?

Tearing my hair and have called for assistance. I managed to break it just changing a line of text in the top bar, so brackets and dollar signs don't look like a good idea at all :(

Now i'm wondering how to removed the OSCMax bit after category names in the top bar, but i suspect i can google the answer to that.

I hate code. It is so not me.

megfenn
31-08-2007, 02:00 PM
Merry, did you get it fixed? Do you want me to take a look? Sorry I've not been on the forum very much so have just seen your post. Meg