Hi,
Pl. see the foll. code :
I need to create a query such that matches userid from Table Users with ip frm Table Office and if there is no match then to "die", else to proceed further.
Could someone guide me on the IF statement pl? Thanks !
$result = mysql_query ("SELECT * from `users` WHERE `userid`= '$userid'");
$myrow = mysql_fetch_array($result);
$officeid = $myrow["officeid"]; // THIS STATEMENT WORKS FINE
$resulta = mysql_query ("SELECT * from `Office` WHERE `officeid`= '$officeid'");
$myrowa = mysql_fetch_array($resulta);
$ip = $myrowa["ip"]; // THIS STATEMENT WORKS FINE
IF (A user from an office logs in with an ip not linked to that office ) die ("You are not authorised to log in from this ip")