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>