I have two tables:
staticip
has two columns:ip
,staticipid
rm_users
has many columns and one of it isstaticipcpe
I would like to find rows in staticip
table that is staticipid='2'
and ip
is not equal staticipcpe
in table rm_users
.
I tried the following sql statement but it didn't work.
$sqls="select s.ip, s.staticipid from staticip s
where s.staticipid='2' and not exists
(select u.staticipcpe from rm_users u
where u.staticipcpe=s.ip";
I have the following message
"Warning: mysql_result(): supplied argument is not a valid MySQL result resource"