così il seguente errore
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'r.user_2 = '61' AND r.amico = 'S' AND r.user_1 = '61' AND r.amico = 'S' '' order' at line 1
così invece questo mex ....
Unknown column 'r.user_2' in 'where clause'
Cavolo secondo me siamo vicini
PHP:
$query = mysql_query("SELECT M.msg_id, M.uid_fk, M.message, M.created, U.username, M.uploads, R.user_1, R.user_2 FROM messages M, users U, relationship AS R WHERE M.uid_fk = U.uid AND M.uid_fk='$uid' IN r.user_2 = '$uid' AND r.amico = 'S' AND r.user_1 = '$uid' AND r.amico = 'S' '$morequery' order by M.msg_id desc limit " .$this->perpage) or die(mysql_error());
//questo mettendo IN ( IN r.user_2 = '$uid' AND r.amico = 'S' AND r.user_1 = '$uid' AN )
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'r.user_2 = '61' AND r.amico = 'S' AND r.user_1 = '61' AND r.amico = 'S' '' order' at line 1
così invece questo mex ....
PHP:
$query = mysql_query("SELECT M.msg_id, M.uid_fk, M.message, M.created, U.username, M.uploads, R.user_1, R.user_2 FROM messages M, users U, relationship AS R WHERE M.uid_fk = U.uid AND M.uid_fk='$uid' OR r.user_2 = '$uid' AND r.amico = 'S' AND r.user_1 = '$uid' AND r.amico = 'S' '$morequery' order by M.msg_id desc limit " .$this->perpage) or die(mysql_error());
// cosi me lo da mettendo OR o AND ( OR r.user_2 = '$uid' AND r.amico = 'S' AND )
Unknown column 'r.user_2' in 'where clause'
Cavolo secondo me siamo vicini