This Function Has Been Available Since:
(AFCommerce v 2.1, Functions v 1.1)
Description
integer = afc_sql_num_rows (answer)
This function calculates the number of rows returned by a database query, uses mysql_num_rows by default.
So when defining a new database type you should find the equivalent function for the database type you want to use.
All the afc_sql functions are found in database-mysql.php (by default AFCommerce uses mysql by default). When new database types are added in to the default version, the file would be named database-dbtype.php, and if you add your own database type, you simply need to change a few lines in this file, and replace the mysql functions with the functions for the database type you are using. This establishes a universal database system that AFCommerce uses, simply include the file that declares the database functions, and AFCommerce can use any type of database out there. You would only need to change the file that the database functions are declared in, and all of the scripts will automatically use the new database type, that is the purpose of the custom database functions that version 2 uses. Inside the web directory, there is a file called "dbconfig.php" which tells AFCommerce which file to include, so you will see right now that your cart will have this variable set to "mysql", hence why the file database-mysql.php is called. If you changed this value to xxx, where xxx is the name of the database type you are using, AFCommerce will automatically know to include a file called database-xxx.php (which you would need to create if that database type doesn't exist in the default version). You only need to understand this if you are creating your own database function declaration file.
Parameters
answer (string) - This is the result from the sql query, by default is the mysql query.
Return Values
Returns the number of rows returned by the database query.
Open Source: YesPaul's Examples There are currently no examples for this function.
|
Back to Functions List
|