EasyUI Forum
May 21, 2024, 03:28:14 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Foreig key  (Read 9025 times)
alexcbn
Newbie
*
Posts: 4


View Profile Email
« on: May 16, 2013, 11:12:49 AM »

Hi, I have a simple question, but I don´t know how to resolve..
In a table 'users' I put a foreign key 'id_city', with your source in table 'city'. But, how shows in a grid the field 'name_city'?

<table id="dg" title="My Users" class="easyui-datagrid" style="width:700px;height:250px"
         url="get_users.php"
         toolbar="#toolbar" pagination="true"
         rownumbers="true" fitColumns="true" singleSelect="true">
      <thead>
         <tr>
            <th field="firstname" width="50">First Name</th>
            <th field="lastname" width="50">Last Name</th>
            <th field="id_city" width="50">City</th> <----here I want show field 'name_city', of table 'city'
            <th field="email" width="50">Email</th>
         </tr>
      </thead>
   </table>

[]´s
Logged
2plus2
Jr. Member
**
Posts: 75


View Profile
« Reply #1 on: May 16, 2013, 06:28:59 PM »

What does your JSON look like that is returned by get_users.php ?
Logged
alexcbn
Newbie
*
Posts: 4


View Profile Email
« Reply #2 on: May 16, 2013, 07:07:58 PM »

Hi 2plus2, I get resolved using INNER JOIN.

Thank´s for your reply!
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!