session_start();
$name = $_GET["username"];
$sql = "SELECT 'id' FROM Users WHERE username='$name'";
$result = mysql_query($sql);
$value = mysql_fetch_object($result);
$_SESSION['myid'] = $value;
到目前为止,我得到:
Catchable fatal error: Object of class stdClass could not be converted to string.
将$value转换为类型字符串不能解决问题.
本文由 投稿者 创作,文章地址:https://blog.isoyu.com/archives/phphemysqlxuanzedangezhi.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:9月 27, 2019 at 08:13 上午