EasyUI Forum
December 08, 2025, 08:40:06 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: HELP DATE_FORMAT (date, '% d /% m /% Y') NOT RUNNING  (Read 14023 times)
impperio
Newbie
*
Posts: 11


View Profile Email
« on: October 07, 2012, 05:46:33 PM »

COMAND LINE
$rs = mysql_query("select date_format(datnasb,'%d/%m/%Y'),nomalub,endalub,telalub,emaalub,
   sql_rowid from tab_cadalu limit $offset,$rows");      

I appreciate any information anticipating many thanks
Imperio - Sao Paulo - Brazil

   
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 08, 2012, 01:09:22 AM »

1. Use 'as' keyword to rename the date field.

Code:
$rs = mysql_query("select date_format(datnasb,'%d/%m/%Y') as datnasb,nomalub,endalub,telalub,emaalub,
   sql_rowid from tab_cadalu limit $offset,$rows");

2. Make sure the date column of datagrid is binded to 'datnasb' field.

Code:
{field:'datnasb',title:'dados',width:100}
Logged
impperio
Newbie
*
Posts: 11


View Profile Email
« Reply #2 on: October 08, 2012, 11:17:25 AM »

Thank you for your attention, and so put date_format (field) that the field is not displayed if no data
follows the code used below

 <table id="dg" title="My Users" class="easyui-datagrid" style="width:900px;height:450px"
         url="get_users.php"
         toolbar="#toolbar" pagination="true"
         rownumbers="true" fitColumns="true" singleSelect="true">
      <thead>
         <tr>                   
                <th field="nomalub" width="50" sortable="true" align="left">Nome</th>
            <th field="endalub" width="50" align="right">Sobrenome</th>
            <th field="telalub" width="50" align="right">Telefone</th>
            <th field="emaalub" width="50">E-mail</th>                                     
                <th field="datnasb" width="50">Data</th>
           
            </tr>
</thead>
Logged
impperio
Newbie
*
Posts: 11


View Profile Email
« Reply #3 on: October 08, 2012, 12:01:46 PM »

many, many thanks for your help I'm even show the ball
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!