I have asked this before but no reply, so could someone have a look at it?
I noticed Drupal 4.6.1 does not support MySQLi, the new MySQL client of PHP 5.
It only supports the old deprecated MySQL client.
Are you planning adding MySQLi support in future Drupal versions?
I have already written some abstraction functions that dynamically detect
which client is installed, and it's GPL. Perhaps you could take some of my code for
a MySQLi-enabled Drupal version. In general it is very very easy to enable MySQLi support, I give an example here: http://jnana.wikinerds.org/index.php/MySQLi
PEAR also supports MySQLi.
Comment | File | Size | Author |
---|---|---|---|
#5 | database.mysqli_1.inc | 5.87 KB | Thox |
#2 | database.mysqli_0.inc | 5.81 KB | Thox |
#1 | database.mysqli.inc | 5.9 KB | Thox |
Comments
Comment #1
Thox CreditAttribution: Thox commentedJust one file for the /includes/ folder. I've tested this on my local machine and it seems that everything is working fine (I didn't do much, add / delete one node, saved admin settings).
Important: I've removed the "CLIENT_FOUND_ROWS" part, as mysqli connects differently. I don't know how essential this is/was and whether it will affect anything like paging?
Comment #2
Thox CreditAttribution: Thox commentedAfter discussion with killes and chx, I found that mysqli does not return the number of matched rows (during an update) as default. It returns the number of changed rows instead.
I've changed my contribution to use a different mysqli connection method (
mysqli_real_connect
), which lets me set theMYSQLI_CLIENT_FOUND_ROWS
flag and return the matched rows.During my tests, I also tried out how
pg_affected_rows()
works. It seems PostgreSQL returns the matched rows by default.See Issue 19442: cache_set sometimes fails for more information on why this flag is important.
Comment #3
chx CreditAttribution: chx commentedI'd put function_exist check into db_connect so that we fail clean if mysqli is not present. I knwo we do not do this is pgsql and mysql connect routines -- maybe we should?
Comment #4
Thox CreditAttribution: Thox commentedAdded
function_exist()
check as per chx's suggestion. Currently set it toreturn false
. Should it usetrigger_error
instead?Comment #5
Thox CreditAttribution: Thox commentedAnd the attachment...
Comment #6
m3avrck CreditAttribution: m3avrck commentedPlease see issue: http://drupal.org/node/29910 ... this one is using out of date database code.