Categories > TinyButStrong general >

display aditional sql data

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: donatello
Date: 2007-05-14
Time: 10:29

display aditional sql data

Hi,
i'm using tbb + plugin by page to display the result of a sql query.
Is it possible - for each record - to display aditional sql data coming from another table?

For example, if i merge a query to display a list of bills, can i display, for each bill, the name of the the customer coming from another table?
The id of the customer is in the bill table, but it's not a foreign key.

Thanks in advance for your answers.
By: TomH
Date: 2007-05-14
Time: 13:01

Re: display aditional sql data


Look in TBS site "Examples" for the "Sub-block" example -- the answer is there for you.

Make a separate array/query from the customer name table and use it as the sub-block.

It is important to merge the main block first, and sub-blocks after it. So...depending on your desired final HTML output - you may just reverse which query is the main / sub query -- it doesn't really matter since youre doing a one-to-one match of bill-to-customer.

Hope that helps get you going,
TomH