July 30, 2010, 10:08:22 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Common questions answered here !
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Query List, How to make one column using 2 and 3 data.  (Read 1440 times)
thekids
Newbie

Offline Offline

Posts: 1


« on: August 12, 2009, 02:30:32 pm »

Dear All,

In db Mysql, i create table with several with colum,

----------
jos_staff
----------
id
name
bachelor
master
doctore
email
---------

if i have a data :
P51229, Thekids ; B.Sc [MIT] , M.Eng [Tohoku] , P.hD [MIT]

I create Query List with colum like this :

------------------------------------------------------------------------
| no  |  id      | name     | education                                  |
------------------------------------------------------------------------
|  1  | P51229  | Thekids | B.Sc [MIT] , M.Eng [Tohoku] , P.hD [MIT]   |
------------------------------------------------------------------------

How to make like this, exactly a column 'education'

thank you very much

thekids






Logged
fvds
Administrator
Living Legend
*****
Offline Offline

Posts: 2321



WWW
« Reply #1 on: August 13, 2009, 05:29:34 am »

A simple approach:
In the querylist, create for education three columns where you put the bachelor, master and doctore va;ues. In the column name of bachelor you put the value "Education" and set the colspan to 3. That will give you three values (if in the database).

A more complicated approach:
You can access the $row from the querylist value. $row holds the current table row and can be accessed like $row->bachelor for the value of bachelor. You can concatenate the values of bachelor, master and doctore with this $row.

HTH
Logged

Fred

Please read the forum rules first!
Please do not use PM for generic questions!
Visit me at OverTheWeb
killerB
Newbie

Offline Offline

Posts: 14



WWW
« Reply #2 on: August 17, 2009, 06:06:20 pm »

To be a bit more precise put this code in the education column.

Code:
<?php return $row->bachelor.', '.$row->master.','.$row->doctore?>


Hope that helps.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by SMF © 2001-2006 Lewis Media
| Terms of Use | Privacy | Sitemap |