Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //db conn............
- $lat= 7;
- $query='SELECT timestamp FROM users';
- $result = mysql_query($query);
- while ($row = mysql_fetch_assoc($result)) {
- $time = strtotime($row);
- $one_week_ago = strtotime('-1 day');
- $a=6;
- if( $time > $one_week_ago ) { //not older than one day
- $p="UPDATE users SET confirm ='$a'";
- if(mysql_query($p))
- {
- echo "$a";
- }
- else{
- echo "wrong";
- }
- }
- else { //older than one day
- $query="UPDATE users SET street= '$lat' WHERE confirm !=$a";
- if(mysql_query($query))
- {
- echo "sucsessful <br>";
- }
- else {
- echo "unsuccessful <br>";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement