PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   Classifieds Bug Reports (http://www.photopost.com/forum/classifieds-bug-reports/)
-   -   database error message(FIXED) (http://www.photopost.com/forum/classifieds-bug-reports/121273-database-error-message-fixed.html)

ncangler December 2nd, 2005 07:44 AM

database error message(FIXED)
 
I received several error messages this morning like the one below. Any idea what would cause this? Thanks.

Quote:

An error was encountered during execution of the query:

SELECT id,catname,template FROM class_categories WHERE id=2forums/images/buttons/collapse_tcat.gif

The query returned with an errorcode of:

Unknown column '2forums' in 'where clause'

Chuck S December 2nd, 2005 08:58 AM

well I would like to know how the query is running for one. Notice the wrap saying is_numeric($cat) well thats definitely not a numeric cat.

elseif ( is_numeric($cat) ) {
$query = "SELECT id,catname,template FROM {$Globals['pp_db_prefix']}categories WHERE id=$cat";
$ctitleq = ppmysql_query($query, $link);
if ( $ctitleq ) {
list( $catid, $thecatname, $Globals['cattemp'] ) = mysql_fetch_row($ctitleq);
}

I would not worry probally an quirk but I do the query is properly sanitized. $cat is ran through the typecast function and there is even a constraint phrase to only run this query is cat is numeric

ncangler December 2nd, 2005 09:05 AM

I have no idea where this came from. The assumption is that someone was in the PHoto Gallery and clicked on something that generated the error message to me. I had about a dozen of them in the inbox this morning.

Chuck S December 2nd, 2005 09:48 AM

Okay most likely a spider. I dont see how that query would run still.

You can do this though

WHERE id='$cat'"; just encapsulate $cat like so '$cat' and you will not get the errors

ncangler December 2nd, 2005 10:23 AM

Where do I make that change? Do you think it is necessary or should I just forget it? Thanks Chuck!

Chuck S December 2nd, 2005 10:49 AM

You dont have to make it as I think this is a spider doing it but it still boggles my mind how that cat string is getting past the php internal is_numeric clause we use to only run that query if cat is numeric. You can surpress the error by encapsulating the variable which means this

In the query meantioned just make WHERE id=$cat to WHERE id='$cat'


All times are GMT -5. The time now is 01:58 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