PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   Photopost Pro How Do I...? (http://www.photopost.com/forum/photopost-pro-how-do-i/)
-   -   Interesting Error - Any ideas...? (http://www.photopost.com/forum/photopost-pro-how-do-i/134460-interesting-error-any-ideas.html)

sean9715 November 30th, 2007 10:47 AM

Interesting Error - Any ideas...?
 
Hey there,

We've been getting reports of the following error. Any ideas of what might be causing this?

> An error was encountered during execution of the query:
>
> SELECT id,cat FROM pp_photos WHERE approved=1 AND storecat=0 AND ((title
> LIKE "% "carnival%" OR description LIKE "% "carnival%" OR keywords LIKE "%

> "carnival%" OR bigimage LIKE "% "carnival%"
> OR extra1 LIKE "% "carnival%" OR extra2 LIKE "%
> "carnival%" OR extra3 LIKE "% "carnival%" OR extra4 LIKE "% "carnival%" OR

> extra5 LIKE "% "carnival%" OR extra6 LIKE "% "carnival%") OR (title LIKE
> ""carnival%" OR description LIKE ""carnival%" OR keywords LIKE
> ""carnival%" OR bigimage LIKE ""carnival%"
> OR extra1 LIKE "%"carnival%" OR extra2 LIKE
> "%"carnival%" OR extra3 LIKE "%"carnival%" OR extra4 LIKE "%"carnival%" OR

> extra5 LIKE "%"carnival%" OR extra6 LIKE "%"carnival%"))AND ((title LIKE
> "% holiday"%" OR description LIKE "% holiday"%" OR keywords LIKE "%
> holiday"%" OR bigimage LIKE "% holiday"%"
> OR extra1 LIKE "% holiday"%" OR extra2 LIKE "%
> holiday"%" OR extra3 LIKE "% holiday"%" OR extra4 LIKE "% holiday"%" OR
> extra5 LIKE "% holiday"%" OR extra6 LIKE "% holiday"%") OR (title LIKE
> "holiday"%" OR description LIKE "holiday"%" OR keywords LIKE "holiday"%"
> OR bigimage LIKE "holiday"%"
> OR extra1 LIKE "%holiday"%" OR extra2 LIKE
> "%holiday"%" OR extra3 LIKE "%holiday"%" OR extra4 LIKE "%holiday"%" OR
> extra5 LIKE "%holiday"%" OR extra6 LIKE "%holiday"%")) ORDER BY date DESC
> LIMIT 50
>
> 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 'carnival%" OR
> description LIKE "% "carnival%" OR keywords LIKE "
>
> If you need assistence or feel this is a 'bug'; please report it to our
> support forums at: http://www.photopost.com/members/forum/f66/index.html
>
> To turn off these emails, set $debug=0 in your config-inc.php file.
>

Chuck S November 30th, 2007 10:49 AM

what are you using as a search term? carnival or "carnival

sean9715 November 30th, 2007 10:55 AM

Chuck - I'm asking the people who gave me the error. Stay tuned!

Chuck S November 30th, 2007 11:10 AM

Yeah you can also test by setting debug setting to display errors and as admin test some different combinations.

sean9715 November 30th, 2007 02:16 PM

Chuck,

The problem is that the error message wasn't sent to us by a user, it was automatically generated and emailed to our photo admin by the "system" (Photopost or vBulletin) when a user ran what appears to be a weird search. There's no way of us knowing who the user is!

Any further suggestions?

Chuck S November 30th, 2007 03:53 PM

yes as posted above you can try entering search terms like carnival or holiday after setting debug option to display errors not email errors. That way you can post what you find.

I am testing on a few sites with no errors thus far thats why I was asking the exact search term I am looking at the error and trying to use what I see to create an error but am unable.

sean9715 December 6th, 2007 01:14 PM

Hey there Chuck,

In speaking to my higher ups, the question came up:

"Is it (meaning changing the debug option) going to give the same information as we got in the email delivery, and if so how does that help us?"

Our fear is that the user will get the same exact message that we get, which leaves us no better (or worse) than we started with.

Chuck S December 6th, 2007 01:34 PM

yes debug option that I stated will allow you to test and try and get the error. I have been testing on my site with variations of what I see above as what might be the search terms and I get nothing.

sean9715 December 7th, 2007 02:54 PM

Okay Chuck!

We figured out the issue and was able to re-create it. If you do a search for anyting with a quote - " - in it, it'll come back with an error. For example, I did a search for "carnival" and got back the following:

We're sorry, but the system experienced an unrecoverable error. Please try again later.

Script:

Query: SELECT id,cat FROM pp_photos WHERE approved=1 AND storecat=0 AND ((title LIKE "% "carnival"%" OR description LIKE "% "carnival"%" OR keywords LIKE "% "carnival"%" OR bigimage LIKE "% "carnival"%" OR extra1 LIKE "% "carnival"%" OR extra2 LIKE "% "carnival"%" OR extra3 LIKE "% "carnival"%" OR extra4 LIKE "% "carnival"%" OR extra5 LIKE "% "carnival"%" OR extra6 LIKE "% "carnival"%") OR (title LIKE ""carnival"%" OR description LIKE ""carnival"%" OR keywords LIKE ""carnival"%" OR bigimage LIKE ""carnival"%" OR extra1 LIKE "%"carnival"%" OR extra2 LIKE "%"carnival"%" OR extra3 LIKE "%"carnival"%" OR extra4 LIKE "%"carnival"%" OR extra5 LIKE "%"carnival"%" OR extra6 LIKE "%"carnival"%")) ORDER BY date DESC LIMIT 50

Result: 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 'carnival"%" OR description LIKE "% "carnival"%" OR keywords LIKE

Database handle: Resource id #25

Please advise.

Chuck S December 7th, 2007 03:52 PM

Okay well hmm dont get that error using quotes but try this line 414 of search.php try this

Code:

Content visible to verified customers only.
change to this

Code:

Content visible to verified customers only.

sean9715 December 10th, 2007 11:04 AM

Chuck,

Thanks. I've added that to the search.php. I've tested it and the error is not coming up anymore. Hopefully that will solve it going forward. Thanks!

Chuck S December 10th, 2007 11:05 AM

Not a problem glad to help and let me know if there is anything else we can do to assist.


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

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


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97