@H_301_11@
$database_name = "dbname";
$MysqL_host = "localhost"; //almost always 'localhost'
$database_user = "dbuser";
$database_pwd = "dbpass";
$dbc = MysqL_connect($MysqL_host,$database_user,$database_pwd);
if(!$dbc)
{
die("We are currently experiencing very heavy traffic to our site,please be patient and try again shortly.");
}
$db = MysqL_select_db($database_name);
if(!$db)
{
die("Failed to connect to database - check your database name.");
}
$sql = "SELECT * FROM `table` WHERE `field`= 'value'";
$res = MysqL_query($sql);
while($row = MysqL_fetch_assoc($res)) {
// code here
// access variables like the following:
echo $row['field'].'
';
echo $row['field2'];
}
?>
检出MysqL_fetch_assoc MysqL_fetch_array和MysqL_fetch_object
这是非常基础的知识,您将需要搜索教程.有很多关于.