PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |

Go Back   PhotoPost Community > PhotoPost Support > PhotoPost Classifieds Support > Classifieds Bug Reports

Classifieds Bug Reports Post any problems you may be having with Classifieds here.

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old April 30th, 2008, 04:42 PM   #1 (permalink)
Member
Verified Customer
 
Join Date: Jan 2004
Posts: 220
3.0.1 Another mysql error

We got this error several times now:


An error was encountered during execution of the query:

SELECT id,bigimage,cat,userid,approved FROM cp_products WHERE cat= AND approved=1 ORDER BY disporder,date DESC

The query returned with an errorcode of:

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 'AND approved=1 ORDER BY disporder,date DESC' at line 1


I wasn't able to track it down yet, but this type of query is used in showfeature.php, showphoto.php and showproduct.php. Seems that $cat isn't checked before used in the query.
Astaran is offline   Reply With Quote
Old April 30th, 2008, 04:53 PM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 66,796
I am thinking showframe and that query should be correct we pass $cat to that script it might be an older bug that has been fixed where it might have been using $thecat not $cat
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old April 30th, 2008, 05:01 PM   #3 (permalink)
Member
Verified Customer
 
Join Date: Jan 2004
Posts: 220
It's in line 173 (showframe.php)

$query = "SELECT id,bigimage,cat,userid,approved FROM {$Globals['pp_db_prefix']}products WHERE cat=$cat AND approved=1 $sortcode";

That's the only query in showframe.php that matches the error message.
Some guesses here after a quick look at that script:

Maybe using $dbcat will fix that issue?

If that doesn't work, this part looks a bit suspicious:

if ( !$cat && $limit ) {
$cat = $limit;
}

If limit is '', $cat would be set to that value. $limit isn't checked before that statement.
Astaran is offline   Reply With Quote
Old April 30th, 2008, 06:33 PM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 66,796
I dont beleive that has anything to do with it. This in pp-inc.php for the feature ads display sends a cat variable

Code:
Content visible to verified customers only.
I dont see where cat would be empty but basically encapsulating the $cat variable in that query would indeed quiet that error.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting MySQL error ssslippy Photopost Pro Bug Reports 3 May 14th, 2007 02:51 PM
Mysql error StuartDH Photopost Pro Installation & Upgrades 6 February 23rd, 2006 12:51 PM
What is this mysql error? sammyman Photopost Pro Installation & Upgrades 1 March 3rd, 2005 10:32 PM
mysql error? shamrox Photopost Pro Installation & Upgrades 1 June 27th, 2004 06:09 PM


All times are GMT -5. The time now is 11:15 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0