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? Link to comment https://forums.phpfreaks.com/topic/9084-time-and-password/ 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] Link to comment https://forums.phpfreaks.com/topic/9084-time-and-password/#findComment-33435 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.