| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Converted X-Cart 4.1.18 to use mysqli instead of mysql | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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:
Quote:
|
|||||||
#2
|
|||||||||
|
|||||||||
Re: Converted X-Cart 4.1.18 to use mysqli instead of mysql
I am quite interested in this. I have contacted my host to see if PHP is built with MySQLi on our server.
Jason |
|||||||||
#3
|
|||||||
|
|||||||
Re: Converted X-Cart 4.1.18 to use mysqli instead of mysql
When I get a chance, I'll also see about setting up some benchmark tests for X-Cart so I can test the performance differences on my server (if any). Hopefully it actually results in a performance increase. I'll post the results back here.
Jayk, lemme know what you find out Fastest way to find out, is to just go into X-Cart Admin, click on Summary, scroll down to where it's giving info about your server, click on More Info (or Details, can't remember) next to PHP, that'll show you your server's PHP Info page. Search for MySQLi, that'll tell you if it's enabled |
|||||||
#4
|
|||||||
|
|||||||
Re: Converted X-Cart 4.1.18 to use mysqli instead of mysql
if i recall, you need php 5 or higher to use mysqli...
just switching the commands from mysql to mysqli may not show improvements, in fact it may even be slower...you need to keep in mind that mysqli escapes its strings, so there is no need for the mysql_real_escape_string i am hoping that xcart would get around to using prepared statements |
|||||||
#5
|
|||||||
|
|||||||
Re: Converted X-Cart 4.1.18 to use mysqli instead of mysql
Actually, performance varies based upon various conditions. Typically mysqli seems to perform about the same as mysql, but if you use Prepared Statements, you don't have to escape values, and there is a definite speed increase in MySQLi over MySQL
Additionally, MySQLi only auto-escapes strings used in a Prepared Statement. You still need to use mysqli_real_escape_string to sanitize your data otherwise: http://www.php.net/manual/en/function.mysqli-real-escape-string.php |
|||||||
#6
|
|||||||
|
|||||||
Re: Converted X-Cart 4.1.18 to use mysqli instead of mysql
And yes, you need MySQL 4.1+, and PHP 5+
|
|||||||
#7
|
|||||||
|
|||||||
Re: Converted X-Cart 4.1.18 to use mysqli instead of mysql
A simple preliminary page benchmark using X-Cart's benchmark utility shows pretty much the same performance on the homepage. I'll do more testing later on style & category pages.
Quote:
Quote:
|
|||||||
#8
|
|||||||||
|
|||||||||
Re: Converted X-Cart 4.1.18 to use mysqli instead of mysql
Very cool mod.
mysqli is definitely an improvement in many areas and it will be much more common once apps are pushed to php5. mysqli_real_escape_string is a great security feature. The question of course that you are trying to answer is, is it effective given x-cart's code bloat |
|||||||||
#9
|
|||||||
|
|||||||
Re: Converted X-Cart 4.1.18 to use mysqli instead of mysql
lol, exactly Jon
|
|||||||
#10
|
|||||||||
|
|||||||||
Re: Converted X-Cart 4.1.18 to use mysqli instead of mysql
I know this is an older thread, but we're finally implementing MySQLi on a number of our new servers (not forcing existing users to use the mysqli function), but I have a concern over a particular feature;
persistent connections We all know X-Cart loves it's connections, and one of the things that we've almost always had (and see recommended here on the forums on a regular basis) is the persistent connections feature. Since MySQLi doesn't support this, how have people been dealing with this say should they have 200+ visitors on their site at the same time?
__________________
Conor Treacy - Big Red SEO - @bigredseo Search Engine Optimization & Internet Marketing - We Bring Your Website Out Of Hiding! If you can't be found on Google, Bing or Yahoo, you pretty much don't exist on the Internet. Omaha SEO Office with National & Local SEO Services Hourly Consulting - great for SEO Disaster Recovery, Audits and DIY Guidance |
|||||||||
|
|||
X-Cart forums © 2001-2020
|