$ Link = @ mysql_pconnect ('2017. 0.0.1 ', 'root ','');
Mysql_select_db ('mysql', $ link );
$ Query = "SELECT Host, User FROM user ";
$ Result = mysql_query ($ query, $ link );
// The obtained field
While ($ filed = mysql_fetch_field ($ result )){
Echo $ filed-> name ."
";
}
Echo mysql_affected_rows ($ link );
// Obtain the row
While ($ row = mysql_fetch_row ($ result )){
Echo $ row [0]. $ row [1].'
';
}
// $ Query = "create database my_db ";
/* $ SQL = "CREATE TABLE Persons (
FirstName varchar (15 ),
LastName varchar (15 ),
Age int
)";*/
/* $ SQL = "CREATE TABLE Persons (personID int NOT NULL AUTO_INCREMENT,
Primary key (personID ),
FirstName varchar (15 ),
LastName varchar (15 ),
Age int
) "; Set the primary key
*/
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.