I have the following query I have been using and it works well enough for displaying the records I want to delete in phpMyAdmin:
SELECT zen_customers_basket.*
FROM zen_customers_basket, zen_products
WHERE zen_customers_basket.products_id = zen_products.products_id
AND zen_products.products_availability = 'out of stock'
I then check all the records and then delete them. It's fairly quick and painless, but I need a query that will automatically delete these records so I can automate it with some other queries that are scheduled to run once per hour. Any and all help would be appreciated. I know how to delete records but I'm not sure of the proper syntax here since I'm selecting things from two different tables and I don't want to screw anything up.