This topic is locked

A noob question

12/3/2007 4:27:28 AM
PHPRunner General questions
D
Default author

Hi,

Suppose I have 4 tables:
Category:

id

code (varchar (3) - it descripes product category)

description
Products:

id

name

code (foreign key, linked to Category.id)
Price:

id

product (foreign key, linked to Products.id)

price
input:

id

product (foreign key, linked to Products.id)

number
As you can see, products are sorted by categories. On the other hand, each product may have many different prices (that may sound odd, but they require it in such way <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=6960&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' /> ). I would like to have on addinput form all above parameters: dropdown to select a category, dropdown to select a product (dependent, on above-mentioned category dropdown) and dropdown to select a price (dependent on product).

I know how to do it programatically, but litle confused about PHPRunner - is it possible to create such form in visual editor?

J
Jane 12/3/2007

Hi,
you can create custom view on the Datasource tabels tab and then edit SQL query for this view.

Here is a sample:

select

Category.id,

Products.id

Products.code,

Price.product,

Price.price,

input.product,

input.number

from Category inner join Products

on Category.id=Products.code

inner join Price

on Products.id=Price.product

inner join Input

on Products.id=Input.product


And then set up requred fields as dependent dropdown boxes on the "Edit as" settings dialog on the Visual Editor tab.

D
Default author 12/3/2007

Jane,

Thank you very much. I will try it immediately.