"SELECT A.uid,A.name FROM uchome_space AS A INNER JOIN uchome_spacefield AS B ON A.uid=B.uid AND residecity = '$space[residecity]' AND sex != '$space[sex]' "
要用双引号,php才能解析把字符串里面的变量,如果不行 echo 性别的值,再看下数据库的值是怎么样的,匹配好。只可能是自己的错误
先确认$space[“residecity”]和$space[“sex”]有值,
然后试试:
$queryString = "SELECT A.uid,A.name FROM uchome_space AS A INNER JOIN uchome_spacefield AS B ON A.uid=B.uid AND residecity = '".$space[“residecity”]."' AND sex != '".$space[“sex”]."'";
加分吧
我做
你的$space[residecity]和$space[sex]确定获取到值了么,echo下看看.
如果有,把他们先覆给一个变量,再用变量代替试下看看