ShaolinF Posted February 2, 2008 Share Posted February 2, 2008 Hi Guys, 1. I want to create 10 digit random numbers ranging from 0-9 and A-Z. How could I code this ? 2. In my payments table if a user's payment is set as pending for more than 7 days then the DB should automatically remove his order. How can I do this ? Quote Link to comment https://forums.phpfreaks.com/topic/89027-solved-several-questions/ Share on other sites More sharing options...
tibberous Posted February 2, 2008 Share Posted February 2, 2008 2) substr(strtoupper(md5(rand())), 0, 10); Quote Link to comment https://forums.phpfreaks.com/topic/89027-solved-several-questions/#findComment-455958 Share on other sites More sharing options...
toplay Posted February 2, 2008 Share Posted February 2, 2008 I'm sure tibberous meant to specify that he is giving you the answer to your first question and not the second. As to your second question, it's best if you create a PHP script to run one or more queries to do what you want on a daily basis. The PHP script can be scheduled to run daily at a certain time using a cron job (for unix platforms). Search the web about cron jobs or ask your web host provider if they allow you to set them up. # Example of deleting all rows that are older than 7 days DELETE FROM table_name WHERE pending_date < DATE_SUB(CURDATE(), INTERVAL 7 DAY); Quote Link to comment https://forums.phpfreaks.com/topic/89027-solved-several-questions/#findComment-455967 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.