程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> php-新手在此 謝謝各位前輩了!!

php-新手在此 謝謝各位前輩了!!

編輯:編程綜合問答
新手在此 謝謝各位前輩了!!

<?php
$dbms='mysql';
$dbName='luo';
$user='root';
$pwd='root';
$host='localhost';
$dsn="$dbms:host=$host;dbname=$dbName";
try{
$pdo=new PDO($dsn,$user,$pwd);
$query="select * from tb_affiche";
$result=$pdo->prepare($query);
$result->execute();
while($res=$result->fetch(PDO::FETCH_ASSOC)){
?>

刪除

<?php
}
echo "PDO鏈接Mysql";
}catch(Exception $e){
echo $e->getMessage()."
";
}
?>
出現Notice: Use of undefined constant createtime - assumed 'createtime' in D:\WWW\aff.php on line 24
錯誤

最佳回答:


錯誤信息顯示:常量 createtime 未定義

但你給出的代碼中並沒有出現 createtime

估計是你在使用查詢結果時寫作 $res[createtime] 了,改作 $res['createtime'] 就可以了

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved