View Single Post
  #1  
Old 08-23-2007, 09:17 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Arrow Converted X-Cart 4.1.18 to use mysqli instead of mysql

[UPDATE] - After several months of using this code with no issues, I've updated this post with a zip file containing a DIFF (patch file) that can be applied via X-Cart Admin. This DIFF was created using X-Cart 4.1.8

MySQLi is a new extension available in PHP 5, which gives better features and performance over PHP 4's MySQL extension.

I'd suggest reading up about it, and googling mysqli. There are tons of articles about the differences between the 2 extensions.

The code modification is in use at CapeFearStyles, so feel free to visit there to see how the site performs. If you see any issues with the website, or note any performance problems, please let me know

If it proves to be stable & effective, then I'll update this post with a patch for user's to apply to their X-Cart installs.

Anyone that wants to use this patch now, and test it own their own installations while knowing that it's not proven to be stable yet, please send me a Private Message

Cheers

EDIT: btw, CapeFearStyles is running on a server that recently upgraded to PHP 5.2.3 (FastCGI) with MySQLi installed, Apache 2.2.4, MySQL 5.0.45, just as a point of reference

Quote:
Major Features

ext/mysqli supports the new features found in recent versions of MySQL and introduces a few features of its own.

The major features of the extension are:

* A procedural interface that looks very much like the ext/mysql interface
* An object-oriented interface that allows for a use idiom that is both more convenient and easier to extend than the procedural interface
* Support for the new MySQL binary protocol that was introduced in MySQL 4.1. (The new protocol is more efficient that the old one and allows for the support of a broader range of features, such as prepared statements.)
* Support for the full feature set of the MySQL C client library, including the ability to set advanced connection options via mysqli_init() and related functions.

Additionally, the extension has support for additional tracing, debugging, load balancing and replication functionality.

Quote:
Why Switch?

Beyond gaining access to the new features of MySQL 4.1+, why would anyone want to switch to using ext/mysqli?

In addition to the functionality mentioned above, ext/mysqli also has some other serious benefits:

* Greater speed. Enhancements in both the extension and in MySQL have made most operations faster, with certain operations becoming up to 40 times faster as compared to ext/mysql.
* Better security. In older versions of the MySQL RDBMS, the possibility existed for an attacker to extract weak password hashes from the network and then recreate a user's password. The new authentication procedure is much more robust and mirrors the attack-resistant authentication procedure of tools like SSH.
Attached Files
File Type: zip mysqli_xcart_418.zip (4.5 KB, 179 views)
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote