Jump to content

[SOLVED] showing date from mysql


arn_php

Recommended Posts

I have a table within the mysql that has a date entry.  I would like to show it on the webpage using this code: '.stripslashes($row['tgl']).' tgl here is the date data.  The date data is actually : 08-11-2008 but then into my web page, it shows: 1218430800. What is wrong with my code?

 

Thanks.

Link to comment
Share on other sites

You are right! uh.. what's wrong with me? here is the whole code:

<?php

$query="SELECT * FROM arnold_next_meeting WHERE flag_status ='1'";

$result=mysql_query($query);

while($row=mysql_fetch_array($result))

{

echo '<ul>

<li>Date : <b>'.date("M d, Y",$tgl).'</b></li>

<li>Place : <b>'.stripslashes($row['place']).'</b></li>

}

?>

 

Why does it shows the  Date : Dec 31, 1969 ?  Am I putting this wrong?

Link to comment
Share on other sites

<?php
$query="SELECT * FROM arnold_next_meeting WHERE flag_status ='1'";
$result=mysql_query($query);
while($row=mysql_fetch_array($result))
{
echo '<ul>
     <li>Date : '.date("M d, Y",$row['tgl']).'</li>
     <li>Place : '.stripslashes($row['place']).'</li>
}
?>

 

You haven't set $tgl, so I assumed it was a row in your database.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.