1、resource mysql_connect (string server, string username, string password)
  打开一个MySQL连接,如$mysql=mysql_connect("localhost","username","password");
2、bool mysql_close ( [resource link_identifier] )
  关闭一个MySQL连接,如mysql_close($mysql);如果没有指定link_identifier,则关闭最后一次打开的连接,下同。
3、bool mysql_select_db ( string database_name [, resource link_identifier] )
  选择当前操作的数据库。
4、resource mysql_query ( string query [, resource link_identifier] )
  执行一个查询对于SELECT, SHOW等操作,返回结果同mysql_query();对于UPDATE, DELETE, DROP等操作,返回一个布尔值来表示成功与否。这里需要会使用SQL语句,且懂得一些防SQL注入的知识。
5、resource mysql_unbuffered_query ( string query [, resource link_identifier] )
  同mysql_query(),区别是该函数不会缓冲所有的结果,这样能节省许多内存。
6、int mysql_num_rows ( resource result )
  返回查询结果的条数。仅对SELECT操作有效。
7、int mysql_affected_rows ( [resource link_identifier] )
  返回查询结果的条数。仅对INSERT, UPDATE或DELETE有效。另外注意该函数的参数是数据连接句柄。
8、array mysql_fetch_row ( resource result )
  返回一行结果并将指针下移,返回的数组将用数字索引。
9、array mysql_fetch_assoc ( resource result )
  返回一行结果并将指针下移,返回的数组将用列名索引。
10、array mysql_fetch_array ( resource result [, int result_type] )
  返回一行结果并将指针下移,返回的数组将根据result_type指定的方式来索引。result_type可以是:
  MYSQL_ASSOC 用列名索引
  MYSQL_NUM 用数字索引
  MYSQL_BOTH(默认) 同时使用两种索引
11、object mysql_fetch_object ( resource result )
  返回一行结果并将指针下移,返回的对象中的成员是列名。如有一张表中有name列,则:
$row=mysql_fetch_object($result);
echo $row->name;
12、array mysql_fetch_lengths ( resource result )
  返回最后一次查询结果(行)中各数据的长度。
15、int mysql_num_fields ( resource result )
  返回查询结果中的列数。
16、object mysql_fetch_field ( resource result [, int field_offset] )
  返回一个列的详细信息,并将列指针下移。对象成员如下:
name 列名
table 所属表
def 默认值
max_length 最大长度
not_null 是否不能为空
primary_key 是否是主键
unique_key 是否是单键
multiple_key 是否不是单键
numeric 是否是数字类型
blob 是否是BLOB
type 数据类型
unsigned 是否是无符号的数字类型
zerofill 是否已用0填充
17、string mysql_field_name ( resource result, int field_offset )
  返回列名。
18、string mysql_field_type ( resource result, int field_offset )
  返回列的数据类型。
19、int mysql_field_len ( resource result, int field_offset )
  返回列的最大长度。
20、string mysql_field_flags ( resource result, int field_offset )
  返回列的标志,并用空格分隔。如某列的标志可以是:"not_null primary_key auto_increment",可以用explode(" ",$flags)来返回一个数组。
21、bool mysql_field_seek ( resource result, int field_offset )
  将列指针移动到某个位置。
22、bool mysql_data_seek ( resource result, int row_number )
  将数据结果指针移动到某个位置。
23、string mysql_error ( [resource link_identifier] )
  返回错误信息。
24、string mysql_result ( resource result, int row [, mixed field] )
  返回一个单元格的数据。field未指定则返回第一列的数据。
25、bool mysql_free_result ( resource result )
  释放一个查询结果所占内存空间。
26、string mysql_real_escape_string ( string unescaped_string [, resource link_identifier] )
  将字符串中的特殊字符转义。