dc_jt Posted January 15, 2007 Share Posted January 15, 2007 Hi I have 2 tables one called leads and one called status.The leads table contains leads_id, reference_number, status_idThe status table contains status_id, statusIm running a while loop where i get all the information from the leads table, however because I store the status_id it is showing the status_id rather than the actual status i.e Live, New etc.Therefore, how can I get it to show the actual status instead of the number?I was thinking I may have to have another table called linkstatus which would contain linkstatus_id, leads_id and status_id.Would this be the best way to do it and then what would I have to do??Hope someone can helpThanks Quote Link to comment Share on other sites More sharing options...
OOP Posted January 15, 2007 Share Posted January 15, 2007 Hi there,You can use the JOIN statments(inner, or outre based on your requirements) to get the required information from both tables..example:[code]SELECT leads.*, status.*FROM leadsLEFT JOIN status ON leads.status_id = status.status_idWHERE (your where clause if any)[/code]You can modify this statement to suite your requirements Quote Link to comment Share on other sites More sharing options...
dc_jt Posted January 15, 2007 Author Share Posted January 15, 2007 Thanks a lot :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.