mysql_db_query Description: resource mysql_db_query ( string database, string query [, resource link_identifier]) mysql_db_query() selects a database and executes a query on it. If the optional link identifier isn't specified, the function will try to find an open link to the MySQL server and if no such link is found it'll try to create one as if mysql_connect() was called with no arguments. mysql_query Description: resource mysql_query ( string query [, resource link_identifier [, int result_mode]]) mysql_query() sends a query to the currently active database on the server that's associated with the specified link identifier.
我同意 fhy1977227fhy(fhy)说法
mysql_connect($hostname, $user, $password); mysql_select_db("db_name"); $query="select password from load where username='$test_username'"; $result=mysql_query($query); $password_row=mysql_fetch_array($result); $db_password=$password_row[0];
想了解更多的话,你可以看一下帮助
resource mysql_db_query ( string database, string query [, resource link_identifier])
mysql_db_query() selects a database and executes a query on it. If the optional link identifier isn't specified, the function will try to find an open link to the MySQL server and if no such link is found it'll try to create one as if mysql_connect() was called with no arguments.
mysql_query Description:
resource mysql_query ( string query [, resource link_identifier [, int result_mode]])
mysql_query() sends a query to the currently active database on the server that's associated with the specified link identifier.
mysql_select_db("db_name");
$query="select password from load where username='$test_username'";
$result=mysql_query($query);
$password_row=mysql_fetch_array($result);
$db_password=$password_row[0];