How do I read a “,” as “
” in PHP/MySQL?

前端 未结 6 556
傲寒
傲寒 2021-01-27 10:55

So I have this MySQL database and a table and in the rows there a lot of \",\" in them, and I wish when they are output on the screen with PHP to be switched to \"
\" inste

6条回答
  •  后悔当初
    2021-01-27 11:44

    You could try the MySQL REPLACE function to have the data come back from your query already formatted like this:

    Example:

    select replace(column_with_commas_in_strings,',','
    ') as new_string from some_table;

    In your case, something like:

    $result = mysql_query("SELECT replace(alias,',','
    ') as ALIAS FROM characters WHERE namn = 'Jargon'");

提交回复
热议问题