shaqywacky Posted June 9, 2008 Share Posted June 9, 2008 Hi all, I have been working on a script where a user will enter in a date and the script will store it and display how long until that date. I have finished make a script that will insert the numbers into the database but now I'm stuck on the retrieving part. Here my code <html> <?php echo "<table align = 'center' frame = 'void'><tr>"; $Yay = 0; $Query = "SELECT seconds, minutes, hours, days, month, year, name FROM date WHERE user = '$User'" or die(mysql_error()); $Result = mysql_query($Query) or die(mysql_error()); while ($Row = mysql_fetch_row($Result)){ $woo0 = $Row[$Yay]; $Yay++; $woo1= $Row[$Yay]; $Yay++; $woo2 = $Row[$Yay]; $Yay++; $woo3= $Row[$Yay]; $Yay++; $woo4 = $Row[$Yay]; $Yay++; $woo5= $Row[$Yay]; $Yay++; $name = $Row[$Yay]; $Yay++; echo $Row[7]; $Days_left = round(((mktime($woo2, $woo1, $woo0, $woo4, $woo3, $woo5) - time())/86400)); echo "<td align = 'center' <table align = 'center' frame = 'void'> <tr> <td align = 'center'> <h2>$name</h2> </td> </tr> <tr> <td align = 'center'> <h2>$Days_left</h2> </td> </tr> <tr> <td align = 'center'> <h2>Days Left!!</h2> </td> </tr> </table> </td>"; } ?> My problem is, if I make more than 1 countdown(which Is what I need it to do) the second/rest of them will always come out to -3114, no matter what I put in. But the first one works perfect. Also if I try to echo anything past the first row in the database, it won't do anything? I really appreciate any help! Link to comment https://forums.phpfreaks.com/topic/109346-taking-things-out-of-database-and-make-a-table/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.