PHP and MySQL Programming/Common Functions and Operators

From Wikibooks, open books for an open world
Jump to: navigation, search

COUNT[edit]

mysql_query(" SELECT COUNT(*|`field_name`) FROM `table_name` ");

SUM[edit]

mysql> SELECT SUM(`field_name`) FROM `table_name`;
Basic Queries PHP and MySQL Programming
Common Functions and Operators
XML and PHP