Home arrow MySQL arrow Implementing Additional Methods with mysqli and PHP 5

Implementing Additional Methods with mysqli and PHP 5

Welcome to the third installment of the series "Using mysqli in PHP 5." Comprised of three articles, this series teaches you how to use the most important methods and properties included in the "mysqli" extension, which is bundled with PHP 5, in order to get the most out of the MySQL 4.1 database server and above.

TABLE OF CONTENTS:
  1. Implementing Additional Methods with mysqli and PHP 5
  2. Fetching rows, finding IDs and moving result set pointers: implementing the “fetch_array()” and “data_seek()” methods
  3. Counting fields and retrieving rows in a faster way: using the “fetch_assoc()” method and the “field_count” property
  4. Getting information about table fields: using the “fetch_field()”, field_seek()” methods and the “current_field” property
By: Alejandro Gervasio
Rating: starstarstarstarstar / 14
July 10, 2006

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Introduction

If you've been reading up my two previous articles, then quite probably you'll know how to utilize the mysqli's core methods for connecting to MySQL, as well as performing many other useful tasks, such as running single and multiple queries, preparing SQL statements, and using the COMMIT and ROLLBACK features found in MySQL 4.1 and up. What's more, you'll surely recall that this extension allows you to handle one or more result sets via an object-oriented approach, which is very convenient if you're particularly inclined to work with object-based applications.

Additionally, I covered, with numerous hands-on examples, other combinations of handy methods and properties, in order to show you how to perform some common MySQL-related operations. In this case obviously I'm talking about counting the number of rows affected after running a specific query, or determining the number of rows returned by a result set, among others. Of course, one of the best points regarding the use of the "mysql" library rests on how easily it allows you to accomplish all the things (and more) that I mentioned before by using an object-oriented approach, without the need to define custom classes. Once the library is available to your system, you can go ahead and start writing down object-based code.

Well, if I stand behind the previous paragraphs, I must say that the "mysqli" extension offers an impressive set of features, which can be implemented right from the very beginning. However, and speaking of its cool features, in the next few lines, I'm going to show you a few more. Over the course of this last tutorial, I'll be covering some other methods and properties, mainly aimed at finding the IDs after inserting new rows, and obtaining information about specific table fields.

Now, be patient and start reading the last chapter of this story. Let's do it together!



 
 
>>> More MySQL Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
   

MYSQL ARTICLES

- Xeround Releases Free Version of MySQL Cloud...
- Oracle Announces New MySQL Specialization
- Constant Contact Chooses SkySQL for MySQL Su...
- Revoke Statement in MySQL
- The Grant Statement in MySQL
- SuccessBricks Announces ClearDB Availability...
- Building a PHP ORM: Deploying a Blog
- TROSYS Launches Free MySQL Manager and Admin...
- Building an ORM in PHP: Domain Modeling
- Building an ORM in PHP
- MySQL Leads Open Source Market, Gets Cluster...
- Oracle Announces Milestone Release for MySQL
- How to Stop SQL Injection Attacks
- New Defragmentation Solution for SQL Server
- Comparison of MyISAM and InnoDB MySQL Databa...


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap

Dev Shed Tutorial Topics: