How to Make While Loops with PHP for HTML5 and CSS3 Programming
How to Display PHP Variable Values
How to Remove MySQL Accounts

PHP Functions That Communicate with MySQL

PHP provides two sets of functions for communicating with MySQL — the mysql functions and the mysqli (MySQL Improved) functions. Which functions you use depends on the version of MySQL and PHP you’re using.

The mysqli functions were added in PHP 5 for use with MySQL versions 4.1 and later. If you’re using a web hosting company, you need to know whether it offers PHP 5, which version of MySQL it provides, and whether it makes the mysqli functions available.

You’re probably using PHP 5 or later, MySQL 5.0, and the mysqli functions. If your web host doesn't offer the mysqli functions, you need to convert the mysqli functions to mysql functions.

If you installed PHP and MySQL yourself on your own computer planning to develop your PHP scripts locally and upload the finished scripts to your web hosting company, you need to install the same versions and activate the same MySQL support functions that your web host provides.

Otherwise, if you install different versions, even newer ones, the scripts may not behave in the same way on your web host's computer as they do on your local computer.

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Access and Adapt a Database with MySQL Queries
PHP and MySQL Functions
Validate Drop-Downs, Radio Buttons, and Check Boxes in the PHP
Troubleshooting a PHP Script
How to Use One-Dimensional Arrays with PHP for HTML5 and CSS3 Programming
Advertisement

Inside Dummies.com