RON_ron Posted August 12, 2010 Share Posted August 12, 2010 Can someone tell me what is the fault with my code? SELECT date_format(datecolumn,'%d %M %Y') as date FROM news WHERE article_id=$id $query = "SELECT * FROM my_db ORDER BY timestamp DESC"; $results = mysql_query($query); $returnS=""; while($line = mysql_fetch_array($results)) { $returnS.= $line["subject"].",,".$line["$id"].",,".$line["article"].",,".$line["link"].",,,"; } echo $returnS; mysql_close($link); ?> Quote Link to comment https://forums.phpfreaks.com/topic/210563-date_format/ Share on other sites More sharing options...
wildteen88 Posted August 12, 2010 Share Posted August 12, 2010 Can someone tell me what is the fault with my code? Umm, not really. Why what is wrong? Post what you're trying to do and any errors you're getting. Quote Link to comment https://forums.phpfreaks.com/topic/210563-date_format/#findComment-1098575 Share on other sites More sharing options...
litebearer Posted August 12, 2010 Share Posted August 12, 2010 perhaps you are only getting the date info (per your query) AND not displaying it (per your $returnS) Quote Link to comment https://forums.phpfreaks.com/topic/210563-date_format/#findComment-1098578 Share on other sites More sharing options...
RON_ron Posted August 12, 2010 Author Share Posted August 12, 2010 Here's what I want to happen. The mysql date to be in this format %d %M %Y and be in $returnS Quote Link to comment https://forums.phpfreaks.com/topic/210563-date_format/#findComment-1098580 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.