Not sure how to properly word this or do it, which is why I am here lol.
Here is current code:
$sql = "SELECT state FROM list WHERE lead_id = '$lead_id'";
$result = mysqli_query($link, $sql, MYSQLI_USE_RESULT);
if (!$result)
{
echo 'Error: ', $mysqli->error;
}
while($row = $result->fetch_assoc()){
//I need some code here
}
I'm pulling states from a table based on $lead_id, which is given in a previous statement. There's a few thousand records that this will go through and get the State for. I need the best way keep the count for each state in the while loop (or another way if someone suggests). I need to output the state counts in a table later on. Can anyone help me out with this? I'm not sure how to do it or how to go about it.
Thanks. I appreciate any help in advance.