Jump to content

Split in to several echos


RON_ron

Recommended Posts

I'm pulling 10 records here. How do I split the results in to several echos?

 

$query = "SELECT statez, COUNT(statez)FROM mylist GROUP BY statez"; 
$results = mysql_query($query);
$returnS="";
while($line = mysql_fetch_array($results))
{
$returnS.= $line['COUNT(statez)'].",,".$line['statez'].",,,";
}
echo $returnS;
mysql_close($link);
?>

 

I need the code to look like this by showing the (COUNT) number for each state.

$results = mysql_query($query);
while($line = mysql_fetch_array($results))
{
echo $line["number_in_state1"].",,";
echo $line["number_in_state2"].",,";
echo $line["number_in_statee3"].",,";
echo $line["number_in_state4"].",,";
echo $line["number_in_state5"].",,";
echo $line["number_in_state6"].",,";
//etc....
}

Link to comment
https://forums.phpfreaks.com/topic/212944-split-in-to-several-echos/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.