Now I had faced one problem to concatenate a string,Whenever I was got result string, an extra comma has been added end of result string.
Now below is code for remove the one extra character from string in php. Now I am using substr function to remove extra character.
Php Code for Remove Extra chracter from String
- $res=mysql_query($sqlArtist);
- while($row=mysql_fetch_row($res))
- {
- $stIds.=“‘”.$row[2].“‘,”;
- }
- $checkChr=substr(trim($stIds),-1);
- if($checkChr == ‘,’)
- {
- //delete , if it’s last character
- $stIds=substr(trim($stIds),0,-1);
- }