Change Age automatically
Moderator: General Moderators
Change Age automatically
hi guys . im new to php , is it possible to change age value in mysql automatically when year changes ?
Re: Change Age automatically
i think no with mysql alone.. you have to create a program for that in php...
Re: Change Age automatically
thanks for reply my friend ,googling not work for me .. can you tell me how to do that ?
Re: Change Age automatically
you can do a while loop. 
quick code
quick code
Code: Select all
$rows = mysql_query("SELECT * FROM user";) or die(mysql_error());
while ($x = mysql_fetch_array($rows)) {
mysql_query("UPDATE user SET age = age+'1'";)
}