Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in F:\Program Files (x86)\wamp\www\testmysql.php on line 2 ?php $link = mysql_connect(localhost,root,); if (!$link)
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in F:\Program Files (x86)\wamp\www\testmysql.php on line 2
<?php $link = mysql_connect('localhost','root',''); if (!$link) { die('Could not connect to MySQL: ' . mysql_error()); } echo 'Connection OK'; mysql_close($link); ?>
解决方案
将mysql改为mysqli
<?php   $link = mysqli_connect('localhost','root','');  if (!$link) {  <span style="white-space:pre"> die('Could not connect to MySQL: ' . mysqli_error()); } echo 'Connection OK'; mysqli_close($link); ?>
作者:Jackson 出处:http://blog.csdn.net/jackson0714/article/details/44116601