all,
was able to piece together the following php/html code. Basically I
want to push an SQL query and format it, present it to an html
document. The problem appears with the SQL query.
When I execute the query from Mysql, it translates the date/time
perfectly along with the text msg - however when I call this from php
script below, it doesn't produce a date, just the msg text:
<snip>
// Performing SQL query
$query = "select date_format(tim e,'%b %D, %Y at %T
hrs'),
msg_text from journal order by time desc";
$result = mysql_query($qu ery)
or die("Query failed : " . mysql_error());
// Printing results in HTML
echo "<table border=0>\n";
while ($line = mysql_fetch_arr ay($result,
MYSQL_ASSOC)) {
printf("<tr><td ><b>Date:</b> %s
<br><b>Journal: </b> %s<hr></td><tr>\n",
$line["time"],$line["msg_text"]);
<snip>
Does anyone know how I can reformat the date and time into the php
script instead of nothing?
Rgds,
Mike M...
was able to piece together the following php/html code. Basically I
want to push an SQL query and format it, present it to an html
document. The problem appears with the SQL query.
When I execute the query from Mysql, it translates the date/time
perfectly along with the text msg - however when I call this from php
script below, it doesn't produce a date, just the msg text:
<snip>
// Performing SQL query
$query = "select date_format(tim e,'%b %D, %Y at %T
hrs'),
msg_text from journal order by time desc";
$result = mysql_query($qu ery)
or die("Query failed : " . mysql_error());
// Printing results in HTML
echo "<table border=0>\n";
while ($line = mysql_fetch_arr ay($result,
MYSQL_ASSOC)) {
printf("<tr><td ><b>Date:</b> %s
<br><b>Journal: </b> %s<hr></td><tr>\n",
$line["time"],$line["msg_text"]);
<snip>
Does anyone know how I can reformat the date and time into the php
script instead of nothing?
Rgds,
Mike M...
Comment