OK, we have seen everything we need to do except actually get the data. This function will grab a single row from a result set. It will return either a row of data, NULL if there are no more rows, or an error object. The neat thing about this fetchRow function is that you specify the row number you want it to grab. This comes in handy when you are dealing with a DBMS that doesn't support LIMIT or a similar function.
There are three fetch modes you can specify with this function:DB_FETCHMODE_ORDERED - this is the default fetch mode and will return an array with numerical keys.DB_FETCHMODE_ASSOC - this mode returns an array with column names as the keys.DB_FETCHMODE_OBJECT - this mode will return an object with column names as the properties.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |