select auto_id from friend_mail_details where auto_id < 1556092 and to_user="1" order by auto_id DESC LIMIT 1
SELECT auto_id FROM friend_mail_setting WHERE mail_id ="1555663" AND user_id="1" AND inbox="Yes" LIMIT 1
I need to combine these into 1 quiry and basicly assign the auto_id from both tables into 2 variables, I would greatly appreciate some help with this,
the problem with the above 2 running seperatley is I use this to get the 2 auto_ids to build a link to the next available message for a user, in the above the result from friend_mail_details is used as the value for mail_id when searching friend_mail_setting table, so in the above 1556092 is actually marked as deleted so it does not return the next available value