Check your PMs
I tried entering the SQL query directly into my localhost testbed's phpMyAdmin
which returned an empty result, not an error. Good old line 169Code:SELECT categories_id FROM categories WHERE categories_id='-1';
appears, to my eyes, to be providing the correct formatting.Code:$check_category = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_id='" . $cPath . "'");
There's something else going on, but I'm not sure what ... yet.
I'm not entirely with you on this as my php skills are definitely little league.
I assumed that the coding is OK and that either CEOn or something I added was causing the issue - but lost as to how to determine what exactly
Sorry to be obtuse. Your issue is a puzzler because (1) using a properly-formatted SQL query with a categories_id of -1 (and single-quotes around the value) do not cause errors when issued directly and (2) the formatting provided by your copy of the .php file (to my eyes) looks proper.
One thing that you could try, for grins and giggles, is to make the following (temporary) change to line 169 in tpl_index_product_list.php:
Replace that single line with the three above, repeat the transaction that failed, restore the code to the single-line version and then look to see what the debug-log files have to say. The error_log statement will output the failing query as part of the log's record.Code:$the_query = "select categories_id from " . TABLE_CATEGORIES . " where categories_id='" . $cPath . "'"; error_log (__FILE__ . ': ' . $the_query); $check_category = $db->Execute($the_query);
Hi Lat9
Thanks for the reply .... all very mysterious.
I will quite happily amend the code as you suggested,however the problem I have is that I don't know what triggers the error. You mentioned a failed transaction, so I assume you think it is happening when adding to cart?
Cheers
Brinley