i want to fetch distinct values from an array and also those value should be separated by commas like English,German,French but what i have got is EnglishFrenchGerman.
<?php
$cmd = mysql_query("select language from lang where dispname = 'Sk'");
while($out = mysql_fetch_array($cmd))
{
$res = array_unique($out);
$row = implode(",",$res);
echo "$row";
}
?>
If you cannot see why the code does not do what you expect then dump data out during the processing. Try this :-
<?php
$cmd = mysql_query("select language from lang where dispname = 'Sk'");
while($out = mysql_fetch_array($cmd))
{
echo '<pre>' . print_r($out,true) . '</pre>';
$res = array_unique($out);
echo '<pre>' . print_r($res,true) . '</pre>';
$row = implode(",",$res);
echo $row;
}
?>