Welcome to WebmasterWorld Guest from 54.162.240.235

Forum Moderators: open

Message Too Old, No Replies

Upgrading to MySQLi

with php

     
3:44 am on Jun 19, 2013 (gmt 0)



What am I missing here?

[19-Jun-2013 03:40:44 UTC] PHP Fatal error: Uncaught exception 'Exception' with message 'Database Error [] ' in C:\xampp\htdocs\includes\functions\database_mysqli.php:144
Stack trace:
#0 C:\xampp\htdocs\includes\functions\sessions.php(44): tep_db_fetch_array(NULL)
#1 [internal function]: _sess_write('cfdjqq82e3gcdfu...', 'xxxx|s:4:"n...')
#2 {main}
thrown in C:\xampp\htdocs\includes\functions\database_mysqli.php on line 144


C:\xampp\htdocs\includes\functions\sessions.php line 44:
$check = tep_db_fetch_array($check_query);


C:\xampp\htdocs\includes\functions\database_mysqli.php line 144:
throw new Exception("Database Error [{$db_query->database->errno}] {$db_query->database->error}");


No matter what combo or test I can do, I can't seem to shake these errors.
The site works wonderfully under PHP 5.4 and MySQL, the moment I switch to MySQLi, things break.
3:08 am on Jun 23, 2013 (gmt 0)



After additional testing, it appears to be a sessions issue.
Curious why sessions worked OK with MySQL, but are acting up with MySQLi?

PHP Fatal error: Uncaught exception 'Exception' with message 'Database Error [] ' in C:\xampp\htdocs\includes\functions\database_mysqli.php:147
Stack trace:
#0 C:\xampp\htdocs\includes\functions\sessions.php(49): tep_db_fetch_array(NULL)
#1 [internal function]: _sess_write('1mns1a6skei1qnh...', '')
#2 {main}
thrown in C:\xampp\htdocs\includes\functions\database_mysqli.php on line 147


Line 49 of sessions.php:
 $check_query = tep_db_query("select count(*) as total from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
Line 49: ---> $check = tep_db_fetch_array($check_query);


The session does exist and is visible in the sessions table of phpmyadmin.
3:10 pm on Jul 1, 2013 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



There is no error being thrown according to your trace dump:

'Database Error [] '

I would have expected to see an error number in there. Are you sure you are establishing a connection to the DB first?
 

Featured Threads

Hot Threads This Week

Hot Threads This Month