Using DATE_FORMAT in MySQL

67 views

What is DATE_FORMAT ?? How to use DATE_FORMAT in MySQL using PHP???

  1.  <?
  2. mysql_connect(‘localhost’);
  3. mysql_select_db(‘computereducationworld’);
  4. $result = mysql_query(
  5. "select id, email,
  6. date_format(ts,’W M D, Y %r’) as d
  7. from users order by ts");
  8. if($result) {
  9. while($row = mysql_fetch_assoc($result)) {
  10. echo "$row[id] - $row[email] - $row[d]
  11. \n";
  12. }
  13. } else {
  14. }
  15. ?>



« Select data using mysql_fetch_array() Change existing rows in MySQL using UPDATE »
Posted on Monday, March 9th, 2009 at 4:38 pm under Basic of MySQL | RSS 2.0 Feed

Post Comment

You must be logged in to post a comment.



ComputerEducationWorld.com All Rights Reserved © RSS | CBSE | Education Boards Of India | What is My IP?