字符串要加引号 例:$data = M(‘User‘)->where("username = ‘$username‘ ")->find(); 也可以写成数组格式 例:
$username = array( ‘username‘=>I(‘post.user‘),);$data = M(‘User‘)->where($username)->find(); 如果是数字就可以不加引号
$data = M(‘User‘)->where(‘id = ‘. $id)->find();
时间: 2024-10-03 22:25:40