I have 2 tables. I want to check the very last data inserted in the tables. So, I want to retrieve the last data from both tables and then check if that last data from both tables are same or not.
$q1 =   "SELECT * ".
        "FROM `admin`, `student` ".
        "ORDER BY `admin`.`id` DESC  LIMIT 1 ".
        "INTERSECT".
        "SELECT *".
        "FROM `admin`, `student`".
        "WHERE `admin`.`pcode` = `student`.`code` AND
`admin`.`puser_name` = `student`.`puser_name`";
I cannot use intersect operator so I am getting difficulty in changing in other form.