Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1064 You have an error in your SQL syntax near '' at line 1


itbejared

Recommended Posts

hey guys... I am recieving this error after i add an item to the cart and then press the continue shopping button...

here is the full error:

1064 - You have an error in your SQL syntax near '' at line 1



select pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '27' order by 



[TEP STOP]

 

Now these are buttons that I have added via HTML to add items to the shopping cart. Please take a look yourself at

http://www.wholesale-magazines.com/catalog...products_id=516

click any of the three 'buy now' buttons to add the item, then press the 'continue shopping' button.

 

adding the items to the cart works great, its only the use of the continue shopping button that creates this error.

 

Thanks for your help!

Link to comment
Share on other sites

Somewhere you have changed something that is building the continue button link to read:

 

http://www.wholesale-magazines.com/catalog/default.php?cPath=66_27?NONSSL&sort=2a&page=1&products_id=518

 

That ?NONSSL is what is breaking it.

Link to comment
Share on other sites

Thanks for the quick response Linda..

 

I tried removing the ?NONSSL like you advised and still same error. The sad thing is I didn't realize this until after I did the exact same thing on 400 different products... ugh.... I just hope its fixable...

Link to comment
Share on other sites

i've been entering product like mad the past week to try and get it all in.. and now I don't want to enter any more due to the fact of this problem :cry:

 

it's all a big learing expirience...

Link to comment
Share on other sites

Did you change something specifically on that continue button?

 

half the time it works ... half the time not.

 

If I take out the ?NONSSL from the link that gives the error msg then the page is fine.

Link to comment
Share on other sites

what I did for those links is to use the "buy now" button link that shows up when listing all the products under a certain category.

such as here: http://www.wholesale-magazines.com/catalog...th=66_61?NONSSL

 

and used that in the actually product page (if that makes sense)

 

any products that I have added the 'buy now' button myself, after in the shopping cart the continue shopping button will not work correctly. Now when I try to remove the ?NONSSL its not working for me.. I still get the same error... :cry:

Link to comment
Share on other sites

You should not see that NONSSL in your URL, if I am not mistaken.

 

And if it was suppose to be there, then it would be &something=NONSSL or ?something=NONSSL

 

I think you have a syntax error and have the NONSSL where it should not be on your link.

 

What snapshot are you working from?

 

What is the peice of code generating that URL? 10 to 1 it's just an itty bitty typo on the function for the link or the code making the link.

Link to comment
Share on other sites

I am using a snapshot form Feb 12th.. not sure if its 2.1 MS1 or 2.2 MS1

 

the code that I am using for those links is actually HTML and I am just putting it in the product description like so:

 

Published Bi-Weekly<br>

First issue usually arrives in 6-8 weeks.<p>



<FONT FACE='arial,helvetica' SIZE='-1'>

<b>26 Issues - 1 year</b><br>

Cover Price: <s>$91.00</s><br>

<b>Our Price: <b>$13.99</b><br> 

<font color="FF0000">

<b>85% OFF!</b></font>

<BR><A

HREF=/catalog/default.php?cPath=66_27?NONSSL&sort=2a&page=1&action=buy_now&products_id=516><IMG VSPACE=8 HSPACE=0 ALT='Buy  Subscription' SRC='http://www.wholesale-magazines.com/catalog/includes/languages/english/images/buttons/button_buy_now.gif' BORDER=0 WIDTH=60 HEIGHT=14></a><p>

<BR>

<B>Or choose a different subscription length:</b>

<BR>

<TABLE VALIGN='TOP' CELLPADDING='0' CELLSPACING='6' BORDER='0'

WIDTH='100%'>

<TR VALIGN='TOP'>

<TD ALIGN='LEFT'><FONT FACE='arial,helvetica' SIZE='-1'>

<B>52 Issues - 2 Years</b>

<BR>Cover Price: <S>$182.00</s><BR><B>Our Price: $26.00</b>

<BR><FONT COLOR='#FF0000'><B>86% OFF</b>!</font>

<BR><A

HREF=/catalog/default.php?cPath=66_27?NONSSL&sort=2a&page=1&action=buy_now&products_id=517><IMG VSPACE=8 HSPACE=0 ALT='Buy Subscription' SRC='http://www.wholesale-magazines.com/catalog/includes/languages/english/images/buttons/button_buy_now.gif' BORDER=0 WIDTH=60 HEIGHT=14></a>

<BR>

</font></td>

<TD ALIGN='LEFT'><font size="-1">

<B>78 Issues - 3 Years</b>

<BR>Cover Price: <s>$273</s><BR><b>Our Price: $37.00</b>

<Br><Font Color='#FF0000'><b>86% OFF</b>!</font>

<BR><A

HREF=/catalog/default.php?cPath=66_27?NONSSL&sort=2a&page=1&action=buy_now&products_id=518><IMG VSPACE=8 HSPACE=0 ALT='Buy Subscription' SRC='http://www.wholesale-magazines.com/catalog/includes/languages/english/images/buttons/button_buy_now.gif' BORDER=0 WIDTH=60 HEIGHT=14></a>

<br>

</font></td>

<TD ALIGN='LEFT'><FONT FACE='arial,helvetica' SIZE='-1'>

<B>104 Issues - 4 Years</b>

<BR>Cover Price: <s>$364.00</s>

<BR><B>Our Price: $49.00</b>

<BR><FONT COLOR='#ff0000'><B> 87% OFF</b>!</font>

<BR><A

HREF=/catalog/default.php?cPath=66_27?NONSSL&sort=2a&page=1&action=buy_now&products_id=519><IMG VSPACE=8 HSPACE=0 ALT='Buy Subscription' SRC='http://www.wholesale-magazines.com/catalog/includes/languages/english/images/buttons/button_buy_now.gif' BORDER=0 WIDTH=60 HEIGHT=14></a>

<BR>

</font></td>

</tr>

</table><p>

<b><u>ESPN</b></b></u>: Sports reporting the way it ought to be- with oversized photography, off-the-field athlete interviews, season previews and predictions, coverage of pro and college football and basketball, baseball and hockey in every issue. Plus regular columns, inside information and much more!

 

thank you SOOOOO much for your help Linda..

Link to comment
Share on other sites

:lol: Yeah... not going to work with OSC? I thought I was soo smart and catching on... oh great... Well it works good til someone clicks the 'continue shopping' button.. So I was close... :wink:

 

If this isn't doable, do you know any way I can get that same look from the products page to show ALL the available subscriptions for with a 'buy now' option? I NEED something that looks the same but functional.. lol

Link to comment
Share on other sites

How good are you at Global replacements? 8)

 

All the addresses need to be fixed.

 

Let's say your address is:

><A 

HREF=/catalog/default.php?cPath=66_27?NONSSL&sort=2a&page=1&action=buy_now&products_id=516>

 

It needs to be:

><A 

HREF=/catalog/default.php?cPath=66_27&sort=2a&page=1&action=buy_now&products_id=516><

 

It could be even shorter and just be:

catalog/default.php?cPath=66_27&action=buy_now&products_id=516

 

Or, the bare essentials ...

catalog/default.php?action=buy_now&products_id=516

 

Now, debate this ...

 

Edit all the pages you hard coded ... or explain to me really really really slow what makes you know these products go together so that it could logically be coded to do this on the fly for you based on each magazine?

Link to comment
Share on other sites

Ok... basically what I have on my hands is a list of over 900 magazines. Now of these 900 some have 2, 3 or 4 year subscriptions available. So what I am doing is say ESPN have 4 different subscriptions the customer can choose from. 1, 2, 3 or 4 year subscription, so I make products for each ranging from 519 - 522 for the product numbers. Now when someone searches for ESPN it will show all four subscriptions. they click on one.. and I wanted it to show all four so they can choose which of the four they want. like so: http://www.wholesale-magazines.com/catalog...products_id=516

 

Thats the reason that I wanted them all together....

 

I hope I answered your question.

Link to comment
Share on other sites

Is there something a little more logical about this like:

 

exact model number-01

exact model number-02

exact model number-03

exact model number-04

 

Anything that is more logical than just 4 products_id numbers that could get messed up?

Link to comment
Share on other sites

all that I have been doing is taking those four product number (that OSC assigns when you create a new product) and making hardcoded links for them on each of the four different product pages.

 

Granted I think that I am going about this completely the hard way. using something like you said with

exact model number-01

exact model number-02

exact model number-03

exact model number-04

makes a lot more sense..

 

maybe you have an idea that could help simplify things for me also...

 

(by the way, I tried the links that you suggested and I still recieved the error.. maybe recoding them one by one won't work)

Link to comment
Share on other sites

I have a number of ideas on how to do this and automate the product groups for the magazines.

 

I just have to chew on it a bit for the best method.

Link to comment
Share on other sites

well all that I have to say is, THANK YOU SOOO MUCH!!!! I really owe you one for that! I was thinking that I was doing soo well and trying to get all those in asap.

 

Oh well, it's all a learning experience. :roll:

Link to comment
Share on other sites

after I get this all resolved and figured out (with your help), I am going to delve into the PHP a little more and see if i can't figure something out for making that alphabetically listing that I asked about earlier, to list all the magazines from A - Z... I am going to get something right dang it.. :lol:

Link to comment
Share on other sites

after I get this all resolved and figured out (with your help), I am going to delve into the PHP a little more and see if i can't figure something out for making that alphabetically listing that I asked about earlier, to list all the magazines from A - Z... I am going to get something right dang it.. :lol:

 

That is on the To Do List ... just have not gotten to it yet ... 8)

Link to comment
Share on other sites

If you find yourself entering something very repetitive into a computer, then you are probably doing something wrong. Computers are there to do the repetitive stuff for us.

 

With your original approach, the problem for you comes when you want to change the price of a subscription - you have to enter it in several places, and you can imagine trying to get the prices brought back into line if a mistake is made somewhere.

 

What you need is some kind of function that will display the details of just one product in the format you want (the table with the years and cost and reduction ('specials') etc. Next you need some way of linking several of these products together (perhaps the title of the product up until the first colon, or anything in the title in quotes - something like that). Finally you need to alter the product page so that it displays a table for the main product then a table for each related product it finds in the database.

 

You should not have to enter the HTML for a product details table more than once - the function will repeat it for you as many times as needed.

 

Does that make sense?

 

-- JJ

Link to comment
Share on other sites

yeah that makes perfect sense.. All I need to do is to somehow figure exactly how to do it.

 

Okay. We know where we are heading, which is half the battle.

 

First we can look at the data structures. Do the tables available now provide you with the ability to store everything you want to store on a product, or would you need to create somewhere new to store that information?

 

For example, you have a price, a 'special' price, a manufacturer, a title, a description, a category, an image, a weight, a model - can you use these to store everything you need to store on a subscription? Can you use the 'model' to store the type of subscription? If you have a normal price and a special price, then would you really need to store the percentage saving?

 

Write yourself a list of the data items you have for each publication, and see how it maps onto the current model. Forget about how you get to display those details at this stage.

 

-- JJ

Link to comment
Share on other sites

ok... looks like I am going to need to make something new to store all the info if we went that way...

 

Do you?

 

model = 52 Issues - 2 Years

normal price = Cover Price: $182.00

specials price = Our Price: $26.00

((normal price - specials price)*100)/normal price = 86% OFF!

description = Published Bi-Weekly First issue usually arrives in 6-8 weeks.

title = ESPN - 1 Year

related products = products sharing title up to first '-', i.e. ESPN

 

Are you using those fields for anything else at the moment?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...