php - Displaying number of results from a MySQL db -


I have a classified website, and it is using MySQL as a database.

My goal is

Problem: There are two types: DB in private with a search term entered in a text input within the form, and the company Show the total number of ads! Advertisement: Private , and Company . The user can specify which performance, or both, so that the three option.

On the website, after displaying the search results, I want to show the user THREE tab: all ads , personal ads < / Code>, company ad .

I have a area in every record in MySQL that contains either the value of either private or company .

I have a way to display advertising, corporate advertising and total number of ads, but it requires multiple questions . For example, if the user checks the personal check box, then only private ads are searched, but I do not know how many company ads are there until I do a new query, Also search for them then add them, and I also have the total NR of ads.

Just wondering if you know a well, then maybe get rid of additional questions?

Thanks

You can use it: