Jump to content

mysqli vs mysql


anneb

Recommended Posts

Hello. I am fairly new to php. I wrote some code using mysqli coding and it failed. Someone helped me rewrite it with mysql. I have two questions:

 

1. Is mysqli better to use? What are the differences?

2. How do I install mysqli if I should be using it? I've seen a little info on the internet about installing it, but all of the instructions assume some knowledge I don't seem to have. I guess I need some more detailed instructions.

Link to comment
https://forums.phpfreaks.com/topic/144181-mysqli-vs-mysql/
Share on other sites

1. Is mysqli better to use? What are the differences?

 

MySQLi is short for "MySQL improved", so yes, it's better to use than the old mysql extension. It "was developed to take advantage of new features found in MySQL systems versions 4.1.3 and newer" and it is "strongly recommended" that you use it if you use MySQL 4.1.3+ (source: http://php.net/manual/en/mysqli.overview.php)

 

2. How do I install mysqli if I should be using it? I've seen a little info on the internet about installing it, but all of the instructions assume some knowledge I don't seem to have. I guess I need some more detailed instructions.

 

Installation instructions are available here: http://php.net/manual/en/mysqli.installation.php

 

On Windows you essentially just need to uncomment the line in php.ini corresponding to that extension.

Link to comment
https://forums.phpfreaks.com/topic/144181-mysqli-vs-mysql/#findComment-756713
Share on other sites

You can create a file like this:

<?php
phpinfo();
?>

and run that file via a web browser. If you can find mysqli in that file then it's installed. Otherwise you'll probably have to talk to your host. If you administrate the server then there is likely a package available for your specific distro. On Gentoo you'll have to add the mysqli use flag for the dev-lang/php package for instance.

Link to comment
https://forums.phpfreaks.com/topic/144181-mysqli-vs-mysql/#findComment-756865
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.