SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    May 2005
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help with php and sql

    i have a database where i have several colums and tables
    in one table i have and uniek id and a colum with id's that links to an other table
    but
    in the first table i have them like this 01,02,03
    the 01 and 02 refers to another table where 01 is for instance the value jhon

    i need to call up all this in my query
    how do i do that ?

    so i need to call up 01, 02 , 03 , 05 etc

    in my page
    please help

  2. #2
    SitePoint Member
    Join Date
    Mar 2004
    Location
    Belgium
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    name of table 1 : tableA
    fields : uid, name, address

    name of table 2 : tableB
    fields: uid , nameid, role

    value of nameid in tableB is related to uid in table A

    query to select all :
    SELECT tableA.* , tableB.* FROM tableA,tableB WHERE tableA.uid = tableB.nameid

    To get the respective values, refer to the table name followed by a . and then the field name :
    tableA.name
    tableA.address
    tableB.role
    etc...

  3. #3
    SitePoint Zealot
    Join Date
    May 2005
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up layout for table





    as you can see how the table is constructed

    so the values in propety table for view (01,02,03 ect)
    are unique id's in view table

    please help out with the query for selecting it
    i need to select each one and seperate by ","
    then echo them in the page
    please help with query ....

    an any one help me out here ???
    Last edited by baddawg; May 24, 2005 at 02:13.

  4. #4
    SitePoint Zealot
    Join Date
    May 2005
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    please help

    if there is anything not clear let me know
    i will try to make it more transperent


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •