DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Created Comma Seperated List From DB
// The following returns a comma seperated list of values from mysql db
// Example: Item1, Item2, Item3
$query = mysql_query("SELECT b.system_name FROM csr_assigned_system a, csr_system b WHERE a.csr_id = '$csr_id' AND b.system_id = a.system_id");
$system_array = array() ;
$i = 0 ;
while ( $row = mysql_fetch_assoc( $query ) )
{
$system_array[ $i ] = $row[ 'system_name' ] ;
$i++ ;
}
$system = implode( ', ', $system_array ) ;
echo $system;




