FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


date_format 'datetime' not working. why? [solved]





devroom
hi

the following is not working:

Code:
$message = "SELECT id,from_user,readed,replied,trash,subject,message,DATE_FORMAT('datetime', '%d-%m-%Y %H:%i:%s') AS sentdatetime FROM #__cpms_inbox WHERE username='$my->username' ";
$message .= " order by id DESC";
$message .= " LIMIT $limitstart, $limit";

$database->setQuery($message);
$result = $database->query();

if (mysql_num_rows($result)<1) { .................


$field[sentdatetime] gives no date and time. and there is a correct datetime value in the table.
The datetime value is inserted trough: $datetime = date('Y-m-d H:i:s');.

It is not the #__cpms_inbox because joomla changes the #_.

Give all your ideas Smile

it had to be DATE_FORMAT(datetime, '%d-%m-%Y %H:%i:%s') AS sentdatetime
Related topics
Why this code dont work ?
[PHOTOSHOP] Making animated wires
The root partition on this server is running out [SOLVED]
For some reasons, I'm holding 2 subdomains
php + forms + variables
Warcraft III port forwarding
Do you believe in God
WPA Security on XP
Toothpaste as an effective facial cleanser
Prevent Website from Bad Referrers / Porn Sites
10 Reasons why PC's crash
DirectAdmin not working! [SOLVED]
"Document not found" in iframe
Why Flash MP3 player not working?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.