smrpgx Posted May 4, 2006 Share Posted May 4, 2006 How do I make it so that every hour, variable $password will change into a random 6-digit number? Quote Link to comment Share on other sites More sharing options...
.josh Posted May 4, 2006 Share Posted May 4, 2006 run this script every hour with a cron job. [code]<?php $newpassword = rand(100000,999999);$conn = @mysql_connect('host','username','pw') or die(mysql_error());$db = @mysql_select_db('database',$conn) or die(mysql_error());$sql = "update tablename set password = '$newpassword' ";$query = mysql_query($sql, $conn) or die(mysql_error());mysql_close($conn);?>[/code] Quote Link to comment 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.