$_SESSION["signed"]=true;
setcookie("cookie", $username);
$sql1="SELECT DR_id from `doctor` WHERE $_cookie['username']='$username'" ;
餐桌医生
==========
DR_id|| DR_email ||
01 || xyz@email.com ||
我可以通过Cookie获取ID
答案 0 :(得分:0)
您的WHERE
子句应为WHERE DR_email='{$_COOKIE['username]}'
之类的列名
答案 1 :(得分:0)
PHP关键字区分大小写。
$_SESSION["signed"]=true;
setcookie("cookie", $username);
$sql1="SELECT DR_id from `doctor` WHERE DR_email ='$_COOKIE['cookie']'" ;