PHP MYSQL print error.
Posted: Wed Jul 16, 2008 6:15 pm
$query = "select date_format(entry_date, '%W, %m/%d%Y - %h:%m:%s %p') from guessbook";
//$query = " select entry_date from guessbook ";
$result = mysql_query($query);
print $query."<br>";
print $result ."<br>";
while ($rows = mysql_fetch_assoc($result))
{ print $rows[entry_date]."<br>";
Why there is no out put ? Is there other way to get it work.
if $query = "select entry_date from guessbook"; The print $rows[entry_date] works fine.
How to format entry_date that works??? Thanks for any input./advice.
<?php
$user='kdao';
$pass='khaidao';
$host='localhost';
$db='kdao';
$table='guessbook';
$conn = mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db,$conn);
$query = "select date_format(entry_date, '%W, %m/%d%Y - %h:%m:%s %p') from guessbook";
//$query = " select entry_date from guessbook ";
$result = mysql_query($query);
print $query."<br>";
print $result ."<br>";
while ($rows = mysql_fetch_assoc($result))
{ print $rows[entry_date]."<br>";
}
mysql_close($conn);
?>
//$query = " select entry_date from guessbook ";
$result = mysql_query($query);
print $query."<br>";
print $result ."<br>";
while ($rows = mysql_fetch_assoc($result))
{ print $rows[entry_date]."<br>";
Why there is no out put ? Is there other way to get it work.
if $query = "select entry_date from guessbook"; The print $rows[entry_date] works fine.
How to format entry_date that works??? Thanks for any input./advice.
<?php
$user='kdao';
$pass='khaidao';
$host='localhost';
$db='kdao';
$table='guessbook';
$conn = mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db,$conn);
$query = "select date_format(entry_date, '%W, %m/%d%Y - %h:%m:%s %p') from guessbook";
//$query = " select entry_date from guessbook ";
$result = mysql_query($query);
print $query."<br>";
print $result ."<br>";
while ($rows = mysql_fetch_assoc($result))
{ print $rows[entry_date]."<br>";
}
mysql_close($conn);
?>