$sql=" SELECT * from `request_location` where requestid = '".$requestid."' ";
$result = mysqli_query($con, $sql);
if(mysqli_num_rows($result)>0)
{
echo "(";
while($row = mysqli_fetch_assoc($result))
{
echo $row["location_tag"];
echo ",";
}
echo ")";
}
I have this above code that displays data in a format where the result is placed within round brackets and each term is separated by a comma
The result that i am getting is like this
(a,b,c,)
Although it seems to be fine but i want that the comma should not appear after c as it is the last term like this
(a,b,c)
Can anyone please tell how to remove comma after the last element