Is there a simpler/more compact way to code this?
The query is the same on the 2 tables:
$sql = "SELECT id FROM users_intake WHERE users_id=5 AND timeStamp LIKE '2005%'";
$result = mysql_query($sql);
$inside1 = mysql_fetch_object($result);
$sql = "SELECT id FROM users_state WHERE users_id=5 AND timeStamp LIKE '2005%'";
$result = mysql_query($sql);
$inside2 = mysql_fetch_object($result);
if (!$inside1 and !$inside2) {
echo "no";
} else {
echo "yes";
}
Thanks
FnL
The query is the same on the 2 tables:
$sql = "SELECT id FROM users_intake WHERE users_id=5 AND timeStamp LIKE '2005%'";
$result = mysql_query($sql);
$inside1 = mysql_fetch_object($result);
$sql = "SELECT id FROM users_state WHERE users_id=5 AND timeStamp LIKE '2005%'";
$result = mysql_query($sql);
$inside2 = mysql_fetch_object($result);
if (!$inside1 and !$inside2) {
echo "no";
} else {
echo "yes";
}
Thanks
FnL