Demo mode with Favourites.

By Toledoh - April 11, 2010

Hi Guys,

When I have members and favourites plugins on my demo site, I get the following error:

MySQL Error: 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 '(demo1271044932-195)__website_favorites WHERE tableOrTag = 'j_product_catalogue'' at line 3


Have I done something wrong, or is this a bug? It seems to work fine when I change demoMode = 0, but as demoMode = 1 I get the error.

The demo site is at http://www.forrest.id.au/nutsnbolts/, the favourites is on the catalogue page.
Cheers,

Tim (toledoh.com.au)

Re: [Jason] Demo mode with Favourites.

By Toledoh - April 12, 2010 - edited: April 12, 2010

Hi Jason,

File attached.

I will send the FTP details through also, as the file contains a lot of includes. Also, it will allow you to change the demo mode settings.

Currently, this page is the only time the error occurs (it's the only use of the favorites plugin) however I will try to get the order process set up today as that will also use the favorites.
Cheers,

Tim (toledoh.com.au)
Attachments:

catalogue.php 8K

Re: [Toledoh] Demo mode with Favourites.

By Jason - April 13, 2010

Hi,

Okay, I'll take a look. If you could send the FTP and CMS details that would be great. Just email them to jason@interactivetools.com, don't post them in the forum.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Toledoh] Demo mode with Favourites.

By Jason - April 14, 2010

Hi,

Since the table_prefix for demo mode contains brackets, we just had to add back tics (`) around the entire table name:
$favoriteNumsQuery = "SELECT recordNum FROM `{$TABLE_PREFIX}_website_favorites` WHERE tableOrTag = '$tableOrTag' AND createdByUserNum = '$currentUserNum'";

This code will now work both in and out of demo mode.

Let me know if you run into any other issues.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/