PHP、MySQL選擇數據庫 ---------------- 002

<?php
	print "Opening the connection to the database server<br />";
	mysql_connect("localhost","root","password");
	print "Select a database<br />";
	$result = mysql_select_db("phpweb");
	if( $result)
	{
		print "Database selected successfully";
	}
	else
	{
		print "There was problem with the database selection<br />";
	}
?>

一旦選擇成功,全部查詢都是針對這個數據庫進行的。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章