Database Class

From MoonDragon Wiki

Jump to: navigation, search

Here is list of php functions that need to be encapsuled on the Database class. Some of them are mean to improve the perfomance of the database connection while others are functions that simply were not encapsuled before.

mysql_fetch_assoc
This function works in the same way as mysql_fetch_array but it only returns a matrix associated by id, and not by number. The association by number is never used, so we encourage using this function instead of mysql_fetch_array .
mysql_num_rows
There is a variety of situations when is neccesary to know the number of rows returned by a query. This function hasn't been encapsuled yet, so we will be adding a method on the Database class.
mysql_real_escape_strings
Its better to use this function instead of the actual method of preventing SQL injections.
mysql_ping
This function can be used to confirm an active connection with the database.
mysql_result
This function can be used as easier way to get the values of the results when only one row is intended to be returned from the query.
Personal tools