Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Database Problem PHP Mysql

Options
  • 26-02-2012 12:50am
    #1
    Closed Accounts Posts: 2


    Hi All,

    Lets say i have a 2 tables
    Table1
    ID(int)
    Name(varchar)

    Table2
    ID2(int)

    ID = ID2

    So on a page if i have ID2 on table 2, i would like to display Name on table1, how would i go about doing this?
    Sorry if it is a bit confusing but let me know if you are confused.


Comments

  • Registered Users Posts: 131 ✭✭CuAnnan


    DevF wrote: »
    Hi All,

    Lets say i have a 2 tables
    Table1
    ID(int)
    Name(varchar)

    Table2
    ID2(int)

    ID = ID2

    So on a page if i have ID2 on table 2, i would like to display Name on table1, how would i go about doing this?
    Sorry if it is a bit confusing but let me know if you are confused.
    What, you mean a join?


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    If you have ID2 in a variable all you need is a WHERE sql lookup...


  • Closed Accounts Posts: 2 DevF


    Yea Id2 is a variable, would you mind writing out the sample code in php?


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    http://www.coursesweb.net/php-mysql/php-mysql-where-like

    There's a million examples out there, best that you read a bit more about it rather than just get the answer given to you.


Advertisement