V
V
Vitaliy_d2015-11-06 10:47:10
PHP
Vitaliy_d, 2015-11-06 10:47:10

How to properly organize the output of information from a mysql table using php according to the given parameters?

There is a table with four fields (company model, price, price 2). Now I am displaying it completely on the page in the form of a table, roughly speaking a price list. Now I decided to make a search using already prepared parameters, i.e.: The first field will be the choice of the company, then the field with models should appear and only then give out information about the model.
The essence of the question is whether it is possible to organize such an output of information from one table, or is it necessary to create several tables? And as I understand it, the choice of firm and model is already pre-set requests?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2015-11-06
@alex-saratov

You can organize from one. Just a little uncomfortable.
1. selection of firms - select firm from TABLE_NAME GROUP By firm - will give the name of firms
2. models select model from TABLE_NAME where firm=selected_firm
and then whatever.
Answered as far as I understood the question.

A
Andrew, 2015-11-06
@drevil

select distinct field from table
will list the unique entries in the field field.
then
select model, price, price2 from table where company=<input field value> on the page

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question