Query sql separated by space

Asked

Viewed 359 times

3

I have the following sql query:

$sql= mysql_query("SELECT dia, GROUP_CONCAT(hora) FROM marcacoes WHERE colaborador_id = {$colaborador_id} GROUP BY dia ");

The result is:

07:30:00,12:00:00,13:30:00,17:00:00

How do I take the comma apart by space?

ex: 07:30:00 12:00:00 13:30:00 17:00:00

1 answer

2


In function GROUP_CONCAT(), define the delimiter with the keyword SEPARATOR.

Scope

GROUP_CONCAT(string SEPARATOR 'delimitador')

Full example:

$sql= mysql_query("SELECT dia, GROUP_CONCAT(hora, SEPARATOR ' ') FROM marcacoes WHERE colaborador_id = {$colaborador_id} GROUP BY dia ");

Browser other questions tagged

You are not signed in. Login or sign up in order to post.