php - SQL statment works in phpMyAdmin but not PDO? -


i have sql query uses php/pdo. using left join. if copy/paste echoed sql in phpmyadmin results come fine. pdo exception in php. have class static variables table , column names called dbmgr. exact error getting below. know sql class works because have other sql code going though same class , functions good.

"fatal error: uncaught exception 'pdoexception' message 'sqlstate[42s02]: base table or view not found: 1109 unknown table 'dbs' in field list' in /usr/share/nginx/html/library/sql.class.php:86 stack trace: #0 /usr/share/nginx/html/library/sql.class.php(86): pdostatement->execute() #1 /usr/share/nginx/html/library/sql.class.php(90): sql::execute() #2 /usr/share/nginx/html/library/actions/api/listdatabases.php(23): sql::results() #3 /usr/share/nginx/html/index.php(43): include('/usr/share/ngin...') #4 {main} thrown in /usr/share/nginx/html/library/sql.class.php on line 86"

my php:

echo $sql = "select `" . dbmgr::$database_db . "`.`" . dbmgr::$database_db_db_id . "`, `" . dbmgr::$database_db . "`.`" . dbmgr::$database_db_description . "`, `" . dbmgr::$database_db . "`.`" . dbmgr::$database_db_icon . "`, `" . dbmgr::$database_db . "`.`" , dbmgr::$database_db_name . "`, `" . dbmgr::$permissions_db . "`.`" . dbmgr::$permissions_db_id . "`, `" . dbmgr::$permissions_db . "`.`" , dbmgr::$permissions_db_level . "`, `" . dbmgr::$permissions_db . "`.`" . dbmgr::$permissions_db_user_id . "` `" . dbmgr::$main_db . "`.`" . dbmgr::$database_db . "` left join `" . dbmgr::$main_db . "`.`" . dbmgr::$permissions_db . "` on  `" . dbmgr::$database_db . "`.`" . dbmgr::$database_db_db_id . "` = `" . dbmgr::$permissions_db . "`.`" . dbmgr::$permissions_db_id . "` , `" . dbmgr::$permissions_db . "`.`" . dbmgr::$permissions_db_user_id . "` = '1';";  sql::query($sql); $result = sql::results(); 


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -