EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: impperio on October 07, 2012, 05:46:33 PM



Title: HELP DATE_FORMAT (date, '% d /% m /% Y') NOT RUNNING
Post by: impperio 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

   (http://imageshack.us/a/img696/542/datatj.jpg) (http://imageshack.us/photo/my-images/696/datatj.jpg/)


Title: Re: HELP DATE_FORMAT (date, '% d /% m /% Y') NOT RUNNING
Post by: stworthy 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}


Title: Re: HELP DATE_FORMAT (date, '% d /% m /% Y') NOT RUNNING
Post by: impperio 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>


Title: Re: HELP DATE_FORMAT (date, '% d /% m /% Y') NOT RUNNING
Post by: impperio on October 08, 2012, 12:01:46 PM
many, many thanks for your help I'm even show the ball