homepage Welcome to WebmasterWorld Guest from 23.21.34.188
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
Upgrading to MySQLi
with php
brokaddr




msg:4585562
 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.

 

brokaddr




msg:4586822
 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.

coopster




msg:4589257
 3:10 pm on Jul 1, 2013 (gmt 0)

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?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved