lb, I agree with Josh. The extra parenthesis are just a convinience some programmers use.
Josh, I think I might have a solution. Instead of incrementing a counter by 1 and echoing the output each time, why not put the number of times each name pops up in an array, with the name being the key? For example, $names["Bob"] = 4; Then on each iteration of the loop, you could use array_key_exists() to check if the name is already in the array; if so, increment it; else, add it to the array and set the value to 1.
This should work:
function showallfulfillerfororder($ordername,$ordernum,$cam
paign,$id)
{
$SQL = "SELECT * FROM fulfillerorder WHERE clientid='$id' AND status!=3 ORDER BY name";
$data = mysql_query($SQL);
$countcampaign = mysql_num_rows($data);
$names = array();
for($t=0; $t < $countcampaign; $t++)
{
$QueryData=mysql_fetch_assoc($data);
$name = $QueryData[name];
if (array_key_exists($name, $names))
$names[name] += 1; // or $names[name]++;
else
$names[name] = 1;
}
foreach ($names as $name => $numTimes)
{
echo "$name -- $numTimes";
}
}
Let me know if it works!