mysqli PHP Extension Overview
Mysqli extension provides us to access the functionality offered by MySQL 4.1 and above.The i in the function name stands for improved (MySQL Improved). The mysqli extension is built using the PHP extension framework.The MySQLi library is much more optimized and quicker than the previous MYSQL library.
The benefits of mysqli extension over mysql extension are:
The following is a simple example of how to use prepared queries
mysqli->prepare($query): A prepared statement is use to prepare a query for execution and the method returns a statement handle.
mysqli_stmt->bind_param($types, $param1): Bind variables to the query and returns TRUE on success or FALSE on failure.Here types can be (s)string , (i)integer , (d)double or (b)blob.
mysqli_stmt->execute(): Execute the prepared query with the given variables and
returns TRUE on success or FALSE on failure.
mysqli_stmt->bind_result(&$data1, &$data2,...): Bind the result set to
given set of variables and returns TRUE on success or FALSE on failure.
mysqli_stmt->fetch(): Fetch a row into the bound variables and returns
TRUE on Success.FALSE on Error.NULL No data exists.
Example table : employee
Here's the PHP code using mysqli extension to access the above mentioned example table.
Re: mysqli PHP Extension Overview
nice man cool
|All times are GMT +5.5. The time now is 13:05.|