Hello,
I tried by occasion to use the alphabetical search also being logged as Admin pressing the (ABC button and then a random letter) and I got the errors quoted below.
I understand that is also a matter of permissions, but I am wondering if that search shudn't be working inside the range of data the user is allowed to view.
Anyone can help me understand?
Thank you.
Type: E_USER_ERROR (256)
Message: mysqli error: [1054: Unknown column 'B' in 'where clause'] in EXECUTE("SELECT COUNT(*) FROM company_data_1 AS r WHERE r.active=1 AND ((r.f_company_name LIKE ? AND (((NOT ((r.f_permission = '2' AND r.f_permission IS NOT NULL))) OR (r.created_by = 1)) OR ((r.id = 1)) OR (((r.f_account_manager IS NOT NULL AND (r.f_account_manager IN (1,2,3,4,5,6,7,8,9)))) OR ((r.f_permission = '2' AND r.f_permission IS NOT NULL)) OR ((r.f_country = 'IT' AND r.f_country IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))) OR ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))))")
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/libs/adodb/adodb-errorhandler.inc.php
Line=79
error backtrace:
[PHP core called function]
function called: handle_epesi_error(256, "mysqli error: [1054: Unknown column 'B' in 'where clause'] in EXECUTE(\"SELECT COUNT() FROM company_data_1 AS r WHERE r.active=1 AND ((r.f_company_name LIKE ? AND (((NOT ((r.f_permission = '2' AND r.f_permission IS NOT NULL))) OR (r.created_by = 1)) OR ((r.id = 1)) OR (((r.f_account_manager IS NOT NULL AND (r.f_account_manager IN (1,2,3,4,5,6,7,8,9)))) OR ((r.f_permission = '2' AND r.f_permission IS NOT NULL)) OR ((r.f_country = 'IT' AND r.f_country IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))) OR ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))))\")
", "/home/mhd-01/www.xxxxxxx.it/htdocs/crm/libs/adodb/adodb-errorhandler.inc.php", 79, Array ("mysqli", "EXECUTE", 1054, "Unknown column 'B' in 'where clause'", "SELECT COUNT() FROM company_data_1 AS r WHERE r.active=1 AND ((r.f_company_name LIKE ? AND (((NOT ((r.f_permission = '2' AND r.f_permission IS NOT NULL))) OR (r.created_by = 1)) OR ((r.id = 1)) OR (((r.f_account_manager IS NOT NULL AND (r.f_account_manager IN (1,2,3,4,5,6,7,8,9)))) OR ((r.f_permission = '2' AND r.f_permission IS NOT NULL)) OR ((r.f_country = 'IT' AND r.f_country IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))) OR ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))))", false, Object (ADODB_mysqli), "SELECT COUNT() FROM company_data_1 AS r WHERE r.active=1 AND ((r.f_company_name LIKE ? AND (((NOT ((r.f_permission = '2' AND r.f_permission IS NOT NULL))) OR (r.created_by = 1)) OR ((r.id = 1)) OR (((r.f_account_manager IS NOT NULL AND (r.f_account_manager IN (1,2,3,4,5,6,7,8,9)))) OR ((r.f_permission = '2' AND r.f_permission IS NOT NULL)) OR ((r.f_country = 'IT' AND r.f_country IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))) OR ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))))", false, "mysqli error: [1054: Unknown column 'B' in 'where clause'] in EXECUTE(\"SELECT COUNT() FROM company_data_1 AS r WHERE r.active=1 AND ((r.f_company_name LIKE ? AND (((NOT ((r.f_permission = '2' AND r.f_permission IS NOT NULL))) OR (r.created_by = 1)) OR ((r.id = 1)) OR (((r.f_account_manager IS NOT NULL AND (r.f_account_manager IN (1,2,3,4,5,6,7,8,9)))) OR ((r.f_permission = '2' AND r.f_permission IS NOT NULL)) OR ((r.f_country = 'IT' AND r.f_country IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))) OR ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))))\")
"))
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/libs/adodb/adodb-errorhandler.inc.php
line 79
function called: trigger_error("mysqli error: [1054: Unknown column 'B' in 'where clause'] in EXECUTE(\"SELECT COUNT(*) FROM company_data_1 AS r WHERE r.active=1 AND ((r.f_company_name LIKE ? AND (((NOT ((r.f_permission = '2' AND r.f_permission IS NOT NULL))) OR (r.created_by = 1)) OR ((r.id = 1)) OR (((r.f_account_manager IS NOT NULL AND (r.f_account_manager IN (1,2,3,4,5,6,7,8,9)))) OR ((r.f_permission = '2' AND r.f_permission IS NOT NULL)) OR ((r.f_country = 'IT' AND r.f_country IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))) OR ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))))\")
", 256)
File: /home/mhd-01/www.xxxxxxxx.it/htdocs/crm/libs/adodb/adodb.inc.php
line 1235
function called: ADODB_Error_Handler("mysqli", "EXECUTE", 1054, "Unknown column 'B' in 'where clause'", "SELECT COUNT(*) FROM company_data_1 AS r WHERE r.active=1 AND ((r.f_company_name LIKE ? AND (((NOT ((r.f_permission = '2' AND r.f_permission IS NOT NULL))) OR (r.created_by = 1)) OR ((r.id = 1)) OR (((r.f_account_manager IS NOT NULL AND (r.f_account_manager IN (1,2,3,4,5,6,7,8,9)))) OR ((r.f_permission = '2' AND r.f_permission IS NOT NULL)) OR ((r.f_country = 'IT' AND r.f_country IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))) OR ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))))", false, "Object (ADODB_mysqli)")
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/libs/adodb/adodb.inc.php
line 1175
function called: _Execute("SELECT COUNT(*) FROM company_data_1 AS r WHERE r.active=1 AND ((r.f_company_name LIKE ? AND (((NOT ((r.f_permission = '2' AND r.f_permission IS NOT NULL))) OR (r.created_by = 1)) OR ((r.id = 1)) OR (((r.f_account_manager IS NOT NULL AND (r.f_account_manager IN (1,2,3,4,5,6,7,8,9)))) OR ((r.f_permission = '2' AND r.f_permission IS NOT NULL)) OR ((r.f_country = 'IT' AND r.f_country IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))) OR ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))))")
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/libs/adodb/drivers/adodb-mysqli.inc.php
line 163
function called: Execute("SELECT COUNT(*) FROM company_data_1 AS r WHERE r.active=1 AND ((r.f_company_name LIKE ? AND (((NOT ((r.f_permission = '2' AND r.f_permission IS NOT NULL))) OR (r.created_by = 1)) OR ((r.id = 1)) OR (((r.f_account_manager IS NOT NULL AND (r.f_account_manager IN (1,2,3,4,5,6,7,8,9)))) OR ((r.f_permission = '2' AND r.f_permission IS NOT NULL)) OR ((r.f_country = 'IT' AND r.f_country IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL))) OR ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '3' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '4' AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = 1 AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))) OR ((r.created_by = 1) OR ((r.f_permission = '5' AND r.f_permission IS NOT NULL)))))", Array (Array (#20)))
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/include/database.php
line 213
function called: GetOne("SELECT COUNT(*) FROM company_data_1 AS r WHERE r.active=1 AND ((r.f_company_name LIKE ? AND (((NOT ((r.f_permission = ? AND r.f_permission IS NOT NULL))) OR (r.created_by = ?)) OR ((r.id = ?)) OR (((r.f_account_manager IS NOT NULL AND (r.f_account_manager IN (1,2,3,4,5,6,7,8,9)))) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL)) OR ((r.f_country = ? AND r.f_country IS NOT NULL))) OR ((r.created_by = ?) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL))) OR ((r.created_by = ?) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL))) OR (((r.f_account_manager = ? AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = ?) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = ? AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = ?) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = ? AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = ?) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL)))) OR ((r.created_by = ?) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL)))))", Array (#20))
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/include/database.php
line 525
function called: call_with_retry("GetOne", Array ("SELECT COUNT(*) FROM company_data_1 AS r WHERE r.active=1 AND ((r.f_company_name LIKE ? AND (((NOT ((r.f_permission = ? AND r.f_permission IS NOT NULL))) OR (r.created_by = ?)) OR ((r.id = ?)) OR (((r.f_account_manager IS NOT NULL AND (r.f_account_manager IN (1,2,3,4,5,6,7,8,9)))) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL)) OR ((r.f_country = ? AND r.f_country IS NOT NULL))) OR ((r.created_by = ?) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL))) OR ((r.created_by = ?) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL))) OR (((r.f_account_manager = ? AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = ?) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = ? AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = ?) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = ? AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = ?) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL)))) OR ((r.created_by = ?) OR ((r.f_permission = ? AND r.f_permission IS NOT NULL)))))", Array (#20)))
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/modules/Utils/RecordBrowser/RecordBrowserCommon_0.php
line 1599
function called: GetOne("SELECT COUNT(*) FROM company_data_1 AS r WHERE r.active=1 AND ((r.f_company_name LIKE ? AND (((NOT ((r.f_permission = %s AND r.f_permission IS NOT NULL))) OR (r.created_by = %d)) OR ((r.id = %d)) OR (((r.f_account_manager IS NOT NULL AND (r.f_account_manager IN (1,2,3,4,5,6,7,8,9)))) OR ((r.f_permission = %s AND r.f_permission IS NOT NULL)) OR ((r.f_country = %s AND r.f_country IS NOT NULL))) OR ((r.created_by = %d) OR ((r.f_permission = %s AND r.f_permission IS NOT NULL))) OR ((r.created_by = %d) OR ((r.f_permission = %s AND r.f_permission IS NOT NULL))) OR (((r.f_account_manager = %d AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = %d) OR ((r.f_permission = %s AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = %d AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = %d) OR ((r.f_permission = %s AND r.f_permission IS NOT NULL)))) OR (((r.f_account_manager = %d AND r.f_account_manager IS NOT NULL)) AND ((r.created_by = %d) OR ((r.f_permission = %s AND r.f_permission IS NOT NULL)))) OR ((r.created_by = %d) OR ((r.f_permission = %s AND r.f_permission IS NOT NULL)))))", Array (#20))
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/modules/Utils/RecordBrowser/RecordBrowser_0.php
line 626
function called: get_records_count("company", Object (Utils_RecordBrowser_Crits), false, Array (Array (#3)))
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/modules/Utils/RecordBrowser/RecordBrowser_0.php
line 332
function called: show_data(Object (Utils_RecordBrowser_Crits), Array (), Array (Array (#3)))
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/include/module.php
line 924
function called: body()
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/include/module.php
line 844
function called: get_html_of_module(Object (Utils_RecordBrowser), Array (), "body")
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/modules/CRM/Contacts/Contacts_0.php
line 74
function called: display_module(Object (Utils_RecordBrowser))
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/include/module.php
line 924
function called: body()
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/include/module.php
line 844
function called: get_html_of_module(Object (CRM_Contacts), Array (), "body")
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/modules/Base/Box/Box_0.php
line 142
function called: display_module(Object (CRM_Contacts))
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/include/epesi.php
line 246
function called: body()
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/include/epesi.php
line 291
function called: go(Object (Base_Box))
File: /home/mhd-01/www.xxxxxxx.it/htdocs/crm/process.php
line 38
function called: process("action_module=%2FBase_Box%7C0%2FCRM_Contacts%7Cmain_27c401146432cfb3efc1ad8cac76730b%2FUtils_RecordBrowser%7Ccompany%2FUtils_GenericBrowser%7Ccompany&%2FBase_Box%7C0%2FCRM_Contacts%7Cmain_27c401146432cfb3efc1ad8cac76730b%2FUtils_RecordBrowser%7Ccompany%2FUtils_GenericBrowser%7Ccompany_quickjump_to=B", "")