PHP Connection Data Operation steps

Source: Internet
Author: User
Tags mysql client

Operation steps for the database:

Port number: 0 to 65535

3306: default port number for MySQL database (modifiable)

mysql_connect ("Native address ","user name", "Password",);

New_link: If you call mysql_connect () for the second time with the same parameters , no new connection will be made and the connection ID that is already open will be returned. The parameter new_link changes This behavior and causes mysql_connect () to always open a new connection, even when mysql_connect () Was previously called with the same parameters.

Client_flags: The parameter can be a combination of the following constants : Mysql_client_ssl, mysql_client_compress, mysql_client_ignore_space or mysql_client_interactive . See MySQL Client Constants for further information.

Return value: Returns a MySQL connection ID If successful , or FALSE on failure.

TCP protocol: The default protocol, one port corresponding to open an application.

API (Application Programming Interface): The content that is called for a specific task.

mysql_select_db ("database name", "MySQL connection.") " ) to set the current activation database on the server associated with the specified connection identifier.

return upon success TRUE , or FALSE on failure.

mysql_query (" SQL query Statement "," MySQL connection ");

return Value: return on successful execution TRUE to return FALSE On error.

Mysql_fetch_array: Gets a row from the result set as an associative array, or as a numeric array, or both.

The default value for this parameter is Mysql_both. If you use mysql_both, you will get an array that contains both associative and numeric indexes. Use mysql_assoc to get the associated index only . use mysql_num only to get a numeric index (as in mysql_fetch_row () ).

Mysql_close (MySQL connection)- close the mysql connection .

If Link_identifier is not specified , the last open connection is closed. mysql_close () is usually not required because a non-persistent connection that has been opened is automatically closed after the script has finished executing .

PHP Connection Data Operation steps

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.