Can someone help me figure this one out?
So in my program I am generating a MySQL query. And to save effort when writing out my WHERE clause at the end of the if else statement I am just trying to remove the last character of the string. Here is the line of code I use
$query = substr_replace($query, " ", strlen($query)-1);
But the last comma that is at the end of the string is never removed. Help please