pixeltrace Posted May 4, 2006 Share Posted May 4, 2006 guys, i need help on this.i have posted this problem before and i thought i already came up with a solutionbut its still not working.what i wanted to happen in my script is that:i have a data with corresponding dates.so on my website, what i wanted to happen isif the date of my data is >= to the systemdatemy site will load upcoming.phpbut when the date of my data is < the systemdatemy site will load noupcoming.php.below is my current script and what it does is,it only loads the noupcoming.php whether my datais >= or < the system date. i short its not functioningto what i wanted it to be. ==========<?include 'db_connect.php';$uSql = "SELECT event_date FROM events";$uResult = mysql_query($uSql, $connection);if(!$uResult){echo 'no data found';}else{while($uRow = mysql_fetch_row($uResult)){$eventdate = $uRow['event_date'];$systemdate = date('y-m-d');}}if ($eventdate >= $systemdate) {$urls = 'upcomingmain.php';}else {$urls = 'noupcoming.php'; }?>===============hope you could help me with this. thanks a lot! Quote Link to comment https://forums.phpfreaks.com/topic/9045-php-help-on-systemdate/ Share on other sites More sharing options...
ansarka Posted May 4, 2006 Share Posted May 4, 2006 [!--quoteo(post=371200:date=May 4 2006, 06:13 AM:name=pixeltrace)--][div class=\'quotetop\']QUOTE(pixeltrace @ May 4 2006, 06:13 AM) [snapback]371200[/snapback][/div][div class=\'quotemain\'][!--quotec--]guys, i need help on this.i have posted this problem before and i thought i already came up with a solutionbut its still not working.what i wanted to happen in my script is that:i have a data with corresponding dates.so on my website, what i wanted to happen isif the date of my data is >= to the systemdatemy site will load upcoming.phpbut when the date of my data is < the systemdatemy site will load noupcoming.php.below is my current script and what it does is,it only loads the noupcoming.php whether my datais >= or < the system date. i short its not functioningto what i wanted it to be. ==========<?include 'db_connect.php';$uSql = "SELECT event_date FROM events";$uResult = mysql_query($uSql, $connection);if(!$uResult){echo 'no data found';}else{while($uRow = mysql_fetch_row($uResult)){$eventdate = $uRow['event_date'];$systemdate = date('y-m-d');}}if ($eventdate >= $systemdate) {$urls = 'upcomingmain.php';}else {$urls = 'noupcoming.php'; }?>===============hope you could help me with this. thanks a lot![/quote][code]<?include 'db_connect.php';$uSql = "SELECT event_date FROM events";$uResult = mysql_query($uSql, $connection);if(!$uResult){echo 'no data found';}else{while($uRow = mysql_fetch_row($uResult)){$eventdate=date("y-m-d", strtotime($uRow[event_date]));$systemdate = date('y-m-d');}}if ($eventdate >= $systemdate) {$urls = 'upcomingmain.php';}else {$urls = 'noupcoming.php';}?>[/code]Plz try this code Quote Link to comment https://forums.phpfreaks.com/topic/9045-php-help-on-systemdate/#findComment-33258 Share on other sites More sharing options...
pixeltrace Posted May 4, 2006 Author Share Posted May 4, 2006 Thanks bro, i'll go ahead and try this one.[!--quoteo(post=371209:date=May 4 2006, 06:49 AM:name=anuka)--][div class=\'quotetop\']QUOTE(anuka @ May 4 2006, 06:49 AM) [snapback]371209[/snapback][/div][div class=\'quotemain\'][!--quotec--][code]<?include 'db_connect.php';$uSql = "SELECT event_date FROM events";$uResult = mysql_query($uSql, $connection);if(!$uResult){echo 'no data found';}else{while($uRow = mysql_fetch_row($uResult)){$eventdate=date("y-m-d", strtotime($uRow[event_date]));$systemdate = date('y-m-d');}}if ($eventdate >= $systemdate) {$urls = 'upcomingmain.php';}else {$urls = 'noupcoming.php';}?>[/code]Plz try this code[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/9045-php-help-on-systemdate/#findComment-33363 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.