mysql_query已经要废弃了。用mysqli_query吧
$host = 'localhost';
$user = 'root';//数据库用户
$password =''; //用户密码
$database = 'nasaplayer';
$mysqli = new mysqli($host,$user,$password,$database);
$query = 'SET NAMES UTF8';
$mysqli->query($query);
if($mysqli->errno){print_f("连接数据库错误<br/> %s",$mysqli->error);}
$host = 'localhost';
$user = 'root';//数据库用户
$password =''; //用户密码
$database = 'nasaplayer';
$mysqli = new mysqli($host,$user,$password,$database);
$query = 'SET NAMES UTF8';
$mysqli->query($query);
if($mysqli->errno){print_f("连接数据库错误<br/> %s",$mysqli->error);}
2017-03-15
require_once('.db.php');$connect = Db::getInstance()->connect();$sql = "SELECT FROM news WHERE `category_id` = 1 AND `status`=1 ORDER BY LIMIT 5";$result = mysql_query($sql, $connect);while($row = mysql_fetch_array($result)){ $news[] = $row;}ob_start();require_once('./template
2017-03-07
@dee0912 , 谢谢你的问题,PHP是解释性语言。但我们PHP语言的引擎zend,先是将PHP代码转化成语言片段,后将片段转化成相关表达式,之后就会将表达式编译成opcodes,是这里用到了编译,请知晓!祝学习愉快!!!
2017-03-06