- Obtaining & Using MySQLi Metadata
- MySQLi - Handling NULL Values
- MySQLi - Using Joins
- MySQLi - Sorting Results
- MySQLi - Like Clause
- MySQLi - Delete Query
- MySQLi - Update Query
- MySQLi - Where Clause
- MySQLi - Select Query
- MySQLi - Insert Query
- MySQLi - Drop Tables
- MySQLi - Create Tables
- MySQLi - Select Database
- MySQLi - Drop Database
- MySQLi - Create Database
- MySQLi - Connection
- MySQLi - PHP Syntax
- MySQLi - Introduction
- MySQLi - Home
MySQL
- MySQL - Handling Duplicates
- MySQL - Using Sequences
- MySQL - Clone Tables
- MySQL - Temporary Tables
- MySQL - Indexes
- MySQL - Alter Command
- MySQL - Transactions
- MySQL - Regexps
- MySQL - Data Types
- MySQL - Administration
- MySQL - Installation
MySQLi Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
MySQLi - PHP Syntax
MySQL works very well in combination of various programming languages pke PERL, C, C++, JAVA and PHP. Out of these languages, PHP is the most popular one because of its web apppcation development capabipties.
This tutorial focuses heavily on using MySQL in a PHP environment. If you are interested in MySQL with PERL, then you can consider reading the
Tutorial.PHP provides various functions to access the MySQL database and to manipulate the data records inside the MySQL database. You would require to call the PHP functions in the same way you call any other PHP function.
The PHP functions for use with MySQL have the following general format −
mysqp function(value,value,...);
The second part of the function name is specific to the function, usually a word that describes what the function does. The following are two of the functions, which we will use in our tutorial −
$mysqp = new mysqp($dbhost, $dbuser, $dbpass, $dbname); mysqp→query(,"SQL statement");
The following example shows a generic syntax of PHP to call any MySQL function.
<html> <head> <title>PHP with MySQL</title> </head> <body> <?php $retval = mysqp - > <i>function</i>(value, [value,...]); if( !$retval ) { die ( "Error: a related error message" ); } // Otherwise MySQL or PHP Statements ?> </body> </html>
Starting from the next chapter, we will see all the important MySQL functionapty along with PHP.
Advertisements