Pulling data from an executed query in php?
So, I've been trying to wrap my head around something, and I haven't had much like finding guidance on the subject online.
Let's say you have a really basic MySQL query like below:
At this point in time, presumably, all your data from your query should exist in the $result variable, right? If that's correct, how do you go about extracting additional queries from that data?
$query = "SELECT * FROM infocall";
$result = mysql_query($query);
Let's say for instance that I have a column entitled "caller" in the "infocall" database. If I wanted to get the number of rows that have a specific entry in the caller column (say "customer"), can I query the results now stored in the $result variable instead of making another query like...
...and then using mysql_num_rows to total the result?
SELECT * FROM infocall WHERE caller LIKE 'customer'