Php reads database records based on parameters. Php reads database records from the database based on parameters. this is a php read database record, but we have processed it in a deeper layer, it is to read the database records from the php database based on the parameters of the parameters passed in the user url address bar. this is a php database reading record, but we have processed it in a deeper layer, it is used to query the parameters passed in the user url address bar from the database, such as user login, registration, adding records, and news display.
Php tutorials read database tutorial records based on parameters
This is a php database reading record, but we have processed it more deeply, that is, to query the parameters passed in the user url address bar from the database, for example, user login, registration, added records and used for news display.
*/
$ Host = 'localhost ';
$ User_name = 'root ';
$ Password = 'admin ';
$ Id = $ _ get ['id'];
$ Conn = mysql tutorial _ connect ($ host, $ user_name, $ password );
If (! $ Conn)
{
Die ('database connection failed: '. mysql_error ());
}
Mysql_select_db ('test ');
$ SQL = 'SELECT id, name, city from users where id = '. $ id;
$ Result = mysql_query ($ SQL) or die ("
Error:". Mysql_error ()."
Problematic SQL: ". $ SQL );
If ($ num = mysql_num_rows ($ result ))
{
Echo'
';
While ($ row = mysql_fetch_array ($ result, mysql_assoc ))
{
Print_r ($ row );
}
}
Else
{
Echo 'The data you want to query already exists ';
}Mysql_close ($ conn );
?>
Query records with id = 2
The handler reads database records, but we perform further processing, that is, we can retrieve the parameters passed in the user url address bar from the database...