Install Error -- mysql_get_server_info()
drubage - January 22, 2008 - 18:48
| Project: | Chat Room |
| Version: | 5.x-1.9 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Jump to:
Description
Hi there,
When I try to install this module I get the following error:
Fatal error: Call to undefined function mysql_get_server_info() in D:\tribalectic\Drupal\sites\all\modules\chatroom\chatroom.install on line 33
I am running Drupal 5.6 with mySql 5.0.41 and PHP 5.2.3. See my phpinfo here:
http://www.tribalectic.com/phpinfo.php
I am using mysqli should that line be different? I thought about just commenting that line out as the check seems unnecessary knowing the versions I have but please any help would be appreciated!
-Drew

#1
Well I commented out these lines and it SEEMS to work:
// if (version_compare(mysql_get_server_info(), '4.1.0', '>=')) {// $utf_declaration = 'DEFAULT CHARACTER SET utf8';
// }
-Drew
#2
if (version_compare(mysql_get_server_info(), '4.1.0', '>=')) {$utf_declaration = 'DEFAULT CHARACTER SET utf8';
}
Just needs to be changed to:
if (version_compare(db_version(), '4.1.0', '>=')) {$utf_declaration = 'DEFAULT CHARACTER SET utf8';
}
This solves it and uses proper Drupal API, and allows Drupal MySQL authentication to take place which is the biggest deal. mysql_get_server_info() is a proper function for MySQL, but it'll try to connect without a password with this command.
Suggest correction in code.
#3
What about Postgre???
#4
i'm not really interested in fixing bugs in the 5.x branch, but i'll help anyone who posts patches. patch anyone?
#5