Shadowing Posted December 19, 2011 Share Posted December 19, 2011 why cant I get this to echo? something so simple i dont understand what im doing wrong. can i simply not beable to display a sql timestamp with out converting 2011-12-19 14:57:45 <?php $ban3 = "SELECT date FROM banned WHERE id = '".mysql_real_escape_string($_SESSION['user_id'])."'"; $ban2 = mysql_query($ban3) or die(mysql_error()); $ban1 = mysql_fetch_array($ban2); $pop = $ban1['date']; echo $pop; ?> Quote Link to comment Share on other sites More sharing options...
melloorr Posted December 19, 2011 Share Posted December 19, 2011 echo "$pop"; Quote Link to comment Share on other sites More sharing options...
Shadowing Posted December 19, 2011 Author Share Posted December 19, 2011 thanks for the responce melloorr i tried that before posting doesnt work either Quote Link to comment Share on other sites More sharing options...
melloorr Posted December 19, 2011 Share Posted December 19, 2011 while ($ban1 = mysql_fetch_array($ban2)) { $pop = $ban1['date']; echo $pop; } Quote Link to comment Share on other sites More sharing options...
Shadowing Posted December 19, 2011 Author Share Posted December 19, 2011 still blank page. hmm i almost about had it with sql timestamps <?php $ban3 = "SELECT date FROM banned WHERE id = '".mysql_real_escape_string($_SESSION['user_id'])."'"; $ban2 = mysql_query($ban3) or die(mysql_error()); while ($ban1 = mysql_fetch_array($ban2)) { $pop = $ban1['date']; echo "$pop"; } ?> Quote Link to comment Share on other sites More sharing options...
Shadowing Posted December 19, 2011 Author Share Posted December 19, 2011 well I ruled out timestamp being the issue I just tried grabing a name and echoing and it didnt work. user matches session id too check that also Quote Link to comment Share on other sites More sharing options...
Stickie Posted December 19, 2011 Share Posted December 19, 2011 try <?php $ban3 = "SELECT date FROM banned WHERE id = '".mysql_real_escape_string($_SESSION['user_id'])."'"; $ban2 = mysql_query($ban3) or die(mysql_error()); while ($ban1 = mysql_fetch_array($ban2)) { $pop = $ban1['date']; echo $pop; } ?> Quote Link to comment Share on other sites More sharing options...
melloorr Posted December 19, 2011 Share Posted December 19, 2011 <?php $ban3 = "SELECT date FROM banned WHERE id = '".mysql_real_escape_string($_SESSION['user_id'])."'"; $ban2 = mysql_query($ban3) or die(mysql_error()); while ($ban1 = mysql_fetch_array($ban2)) { $pop = "{$ban1['date']}"; echo "$pop"; } ?> Try this, I have done this and it worked with me Quote Link to comment Share on other sites More sharing options...
Shadowing Posted December 19, 2011 Author Share Posted December 19, 2011 ahh I figured out whats wrong the field simply didnt exist. Quote Link to comment Share on other sites More sharing options...
melloorr Posted December 19, 2011 Share Posted December 19, 2011 ahh I figured out whats wrong the field simply didnt exist. Its an honest mistake So its all working now? Quote Link to comment Share on other sites More sharing options...
Shadowing Posted December 19, 2011 Author Share Posted December 19, 2011 Yah im good now, thanks alot it wasnt the field missing i meant to say the entire row was missing. I really appreciate the responces from everyone Quote Link to comment 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.