Sql query works in phpmyadmin.
Here is the code:
$ds_bitno->SelectCommand ='
SELECT klijent, zadnja_napomena, date_format(timex , "%m-%d-%Y %H:%i:%s") as timex
FROM nazvatiHist
ORDER BY timex DESC';
$table_order_detail = new GridTableView();
$table_order_detail->Width = "100%";
$table_order_detail->DataSource = $ds_bitno;
$table_order_detail->AddRelationField("klijent","klijent");
// $table_order_detail->AllowSorting = true;
$table_order_detail->AutoGenerateColumns = true;//Auto Generate all column from tables
// $table_order_detail->AllowFiltering = false;//Enable filtering for all rows;
$table_order_detail->DisableAutoGenerateDataFields = "id, username, klijent";//Disable generate column for orderNumber data fields.
name, datatype, format
timex, datetime, CURRENT_TIMESTAMP
I also try many combinations with:
- (UNIX_TIMESTAMP(timex)),
- ORDER BY STR_TO_DATE(timex , "%m-%d-%Y %H:%i:%s") DESC
- SELECT date_format(timex, "%d-%m-%Y")
Anybody?
Tnx
Igor