chemicaluser Posted September 18, 2011 Share Posted September 18, 2011 I have a table in which I am storing a date/time value. It is stored as timestamp. When I try to echo the value, it does not return anything, just a blank field. this is my code (which works for the rest of my form - with non date values) anyone know why it is not working? $arrival_time = $_GET['arrival_time']; <tr> <td align="right" >Arrival Time</td> <td align="left"><input type="text" id="arrival_time_e" name="arrival_time_e" class="input" value="<?php if (!empty($arrival_time)) echo $arrival_time;?>" /></td> </tr> i hava also tried ... which returns the value of 1969-12-31 19:00 (but the dates stored in my database are the right timestamp format, 2011-04-26 22:43:11) <tr> <td align="right" >Arrival Time </td> <td align="left"><input type="text" id="arrival_time_e" name="arrival_time_e" class="input" value="<?php echo date("Y-m-d H:i ", strtotime($row['arrival_time']));?>" /> </td> </tr hope someone can help Quote Link to comment Share on other sites More sharing options...
creata.physics Posted September 18, 2011 Share Posted September 18, 2011 Have you tried to echo only the timestamp itself? echo $row['arrival_time']; If you have not, can you do that and tell me what it prints? Quote Link to comment Share on other sites More sharing options...
chemicaluser Posted September 18, 2011 Author Share Posted September 18, 2011 it does not display anything, just a blank field. Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 18, 2011 Share Posted September 18, 2011 Then that value is not getting passed to the page. What is the full URL that is displayed in the browser when you access this page? Quote Link to comment Share on other sites More sharing options...
chemicaluser Posted September 19, 2011 Author Share Posted September 19, 2011 thanks, lol it works now 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.