将 MySQL 字段添加到 if 语句


adding mysql field to if statment

>任何人都知道为什么下面的代码不起作用

if($out['out'] = '$user')

我不确定如何在 mysql 字段上做if语句。

谢谢

因为不能在单个四分位字符串中使用变量值,所以使用 ==

将"="替换为"==",并删除$user两边的单引号:

if($out['out'] == $user)