JM4
JM4

Reputation: 6788

MySQL results in array with PHP?

I generate a dynamic pdf in which one section relies on a system 'indicator' value for what it actually prints.

The system queries a member table which each member has a Type of 0,1, or 2 (thousands of rows).

At the end of the full query, I need the script to set a variable which is indicative of the whole of results returned by that type field.

For example:

any good way to accomplish this?

Upvotes: 0

Views: 109

Answers (1)

nico
nico

Reputation: 51640

You could just do a query like:

SELECT DISTINCT Type FROM Members WHERE ....

Which will return only 1 to 3 rows.

Then it's just a matter of a few ifs.

PS: you are missing the case where you have 0 and 2.

Upvotes: 3

Related Questions