我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

从mysql中使用php删除逗号

i have a column name fighters which include some value in mysql such as,

| fighters |

| Rock |

| John Cena, |

| UnderTaker,|

So, I want when i Display it in a browser it should appear like

Rock

John Cena

UnderTaker

I just want to remove commas from database using PHP

Any Help will be appreciated..

Give

str_replace(",","",$str);

Use REPLACE() in the SQL query

SELECT REPLACE(fighters, ',', '') FROM  table 

Though why you'd want to do this in query rather than stripping it on the php side if beyond me

近期文章

  • codeigniter form_validation min length不起作用
  • 将JSON导入CodeIgniter
  • 如何在wordpress的前端创建自定义字段? [关闭]
  • SMTP错误:无法进行身份验证
  • PHP - mySql查询执行两次
  • SQL Query基于下拉菜单选择
  • 计算MySQL表行中某种类型值的数量
  • 如何将用户绘制的网页中的SVG转换为PNG或JPG?
  • 通过curl将shell脚本变量传递给远程PHP文件
  • Zend DB得到明显的数量
  • 带有关联数组的PHP str_replace
  • 用php的crypt创建随机盐
  • Php连接到postgresql
  • 使用phpmailer发送到虚假的电子邮件地址
  • 表打印一个单元而不是新行
  • PHP正则表达式检查图像是否用标签包装
  • 我的html页面中的活动元素有问题
  • 获取包含内部链接的变量中的URL [重复]
  • 什么名字会给一个愚蠢的数据类?
  • Android和MySQL:获取mysql_insert_id()并在Android Activity中检索它

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华