gpt4 book ai didi

mysql - php回显问题

转载 作者:太空宇宙 更新时间:2023-11-03 11:15:31 24 4
gpt4 key购买 nike

$this->get_name = mysqli_fetch_assoc(mysqli_query($this->link,"SELECT complete_name FROM student WHERE email='$this->email'"));

mysqli_query($this->link, $this->drop_query) or die(mysql_error());

echo $this->get_name['complete_name']. " has been marked as Left!";

当我运行它时,我得到以下信息:

“约翰已被标记为左派!”

但是当我运行的时候

echo ".$this->get_name['complete_name'] has been marked as Left!";

我明白了:

“数组['complete_name'] 已被标记为左!”

他们不应该打印相同的东西吗?

最佳答案

第二种情况PHP:s解析器不知道变量在哪里结束,使用{}将变量封装在字符串中

echo "{$this->get_name['complete_name']} has been marked as Left!";

关于mysql - php回显问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5354478/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com