欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

php mysql鏁版嵁搴撴搷浣滄暀绋?- PHP鍏ラ棬

程序员文章站 2022-05-25 14:47:13
...
鏈暀绋嬭浜嗕笁涓疄渚嬮兘鏄叧浜巔hp鎿嶄綔mysql鏁版嵁搴撶殑鏁欑▼,涓€鏄繛鎺ysql鏁版嵁搴?浜屾槸鏌ヨ鏁版嵁搴撳瓧娈靛悕瀛?涓夋槸鏌ヨ鏁版嵁搴撹褰?

杩炴帴mysql鏁版嵁搴?浠g爜濡備笅:

$link = mysql_connect("localhost", "mysql_user", "mysql_password") 
or die("could not connect: " . mysql_error()); 
print ("connected successfully"); 
mysql_close($link); 
鏌ヨmysql瀛楁鍚?浠g爜濡備笅:
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); 
$fields = mysql_list_fields("database1", "table1", $link); 
$columns = mysql_num_fields($fields); 
for ($i = 0; $i "; 
}


鏂囩珷缃戝潃:

闅忔剰杞浇^^浣嗚闄勪笂鏁欑▼鍦板潃銆?/p>