[PHP]
Define ("RelativePath", ".");
Include_once (RelativePath. " /db_mysql.class.php "); # DB_mysql.class.php in My resources
$db _mysql = new Db_mysql (); Www.2cto.com
$db _mysql->set_values ("localhost", "* * *", "* * *", "* * *");
# eg: "localhost", "root", "" "," test "
# eg: "localhost or remote IP address", "root", "", "test"
$link = mysql_connect ($db _mysql->mysql_remote_db_host, $db _mysql->mysql_remote_db_username, $db _mysql-> Mysql_remote_db_password);
if (! $link) {
Die ("Not connectted:". Mysql_error ($link));
}
$db _selected = mysql_select_db ($db _mysql->mysql_remote_db_name, $link);
if (! $db _selected) {
Die (the "Can ' t use". $db _mysql->mysql_remote_db_name. " "." The error message is "." ". Mysql_error ($db _selected));
}
/*
else{
echo "has successfully selected:". " ". $db _mysql->mysql_remote_db_name;
}
*/
$sql = "Select User_id,user_email from User_info limit 100";
$query = mysql_query ($sql, $link);
if (! $query) {
Die (Mysql_error ($query));
}
else{
# $num _rows = mysql_num_rows ($query);
# echo $num _rows;
echo mysql_num_rows ($query); # The result is 100
}
?>
http://www.bkjia.com/PHPjc/477909.html www.bkjia.com true http://www.bkjia.com/PHPjc/477909.html techarticle [PHP]? PHP define (RelativePath,.); include_once (relativepath./db_mysql.class.php); # DB_mysql.class.php in my resources $ Db_mysql = new Db_mysql (); www.2cto.com $db _mysql-se ...