2015-11-10 06:48:13
0
Displaying Time and date in 12hour format using mysql select query in php.
DB Name Demo
Table name student
DB Structure
Id firstname lastname pubdate
int(11) varchar(100) varchar(100) timestamp
I have inserted 5 records in student table and displayed using select query everything works great
but i am unable to display pubdate in proper 12 hour format!
please can somebody help me out in
acheiving it Thanks!
Code
$sql = "select id,firstname,lastname,pubdate from student";
$results = mysqli_query($con,$sql);
while($row = mysqli_fetch_array($results))
{
echo $row['id'];
echo $row['firstname'];
echo $row['lastname'];
echo $row['pubdate'];
}