This topic is locked

created by 'X' of 'Y' on 'Z'

8/10/2006 2:27:48 PM
PHPRunner General questions
A
amirgulamali author

Hi,
I want to combine 3 fields in my list page..

the fields are:

  1. created by user (in table 1) - varchar
  2. user group (in users) - varchar
  3. created on (in table 1) -datetime
    right now my table1_list page displays the two fields"created by user" and "created on" on two separate columns and the filed user group is not displayed at all.
    My database users belong to different groups which is stored in the users table under the field user group.
    I want to modify my table1_list page as follows:
    UNDER THE LAST COLUMN (No Label for that column)

    created by "UserID" of "Usergroup" on "datetime"
    Any suggestions would be appreciated,

    Amir

    <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=3153&image=1&table=forumtopics' class='bbc_emoticon' alt=':blink:' />

J
Jane 8/11/2006

Amir,
you can do it using Join clause in the SQL query:

http://www.xlinesoft.com/phprunner/docs/us...sql_queries.htm

Here is a sample query:

select `table1`.`userID`,

`users`.`Usergroup`,

`table1`.`datetime`,

concat('created by ',`table1`.`userID`,'of ',`users`.`Usergroup`,'on ',`table1`.`datetime`) as `full info`

from `table1` inner join `users`

on `table1`.`userID`=`users`.`userID`