Store values in array before processing from database?
Morning Experts - I have a page I am looking to write to replace some OLD code on one of our applications - Basically its a head count for a jail - I was wondering how to best accomplish it. For example, I need a count of all males and females currently in prison, then I need a count of all sentenced and unsentenced males/females in the prison, finally I need a count of all people currently in prison by location code... I am curious if its better to write server SQL queries to get the data (several small count statements) or just one main large select statement and somehow process through the code with PHP and update counters as I go?
For example some of the fields I have in the database (just the ones I'm interested in)
I would think I could just do a
select * from JMS_01MAST where active_booking is not null
and in the while statement somehow do
if (gender = 'M')
else if (gender = 'F')
Then I could redo that same statement somehow and count the other columns?
I know there must be a way to get this all in one big pass, but I cant figure it out...
8/22/2022 - Mon
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!