This article mainly introduces how to operate MySQL in PHP, and analyzes common php skills for mysql database connection, query, modification, update, and deletion in the form of instances, the Zend Development environment encoding setting method is included. if you need it, refer to the example in this article to describe how to operate MySQL in PHP. We will share this with you for your reference. The details are as follows:
Set all UTF-8 codes for Zend software
Demo1.php
Config. php
Demo2.php
';} Mysql_close () ;?>
Demo3.php
'; //} // Echo mysql_field_name ($ result, 2); // name // echo mysql_num_fields ($ result); // 3 for ($ I = 0; $ I
'; Echo mysql_num_rows ($ result); // how many pieces of data echo are obtained'
'; Echo mysql_get_client_info (); // Obtain MySQL client information // 5.0.51a echo'
'; Echo mysql_get_host_info (); // Obtain MySQL host information // localhost via TCP/IP echo'
'; Echo mysql_get_proto_info (); // Obtain MySQL protocol information // 10 echo'
'; Echo mysql_get_server_info (); // Obtain MySQL server information // 5.0.51b-community-nt-log mysql_close ();?>
For more information about how to use PHP to operate MySQL, see PHP Chinese network!