我怎样才能得到结果?:如何获得此MYSQL查询的结果?
$check = mysql_query("select username, email, case
when max(username = '$username') > 0 and max(email = '$email') > 0 then 'both'
when max(username = '$username') > 0 then 'username'
when max(email = '$email') > 0 then 'email'
end
from school_users
WHERE username = '$username' or email = '$email'") or die(mysql_error());
我需要的“用户名”或“电子邮件”或“both”时,它的存在。我如何接收这些变量?
你检查http://php.net/mysql_query? – zerkms 2013-02-10 21:15:45
您不应该使用'mysql_query'函数,因为它已被弃用。改为使用'mysqli_query'。 – Luka 2013-02-10 21:17:46
这可能是他的另一个问题的延续:http://stackoverflow.com/questions/14800674/how-would-i-stop-multiple-emails-or-username。我想你在这里提问之前需要学习一点研究。 – 2013-02-10 21:28:06