Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/235.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 选择时从字段中修剪空格_Php_Mysql_Select_Trim - Fatal编程技术网

Php 选择时从字段中修剪空格

Php 选择时从字段中修剪空格,php,mysql,select,trim,Php,Mysql,Select,Trim,我试图从字段中删除空格(名称前后) 但是它没有做任何事情,正如我在MySQL开发页面中看到的,查询看起来是正确的。 我遗漏了什么吗 我也尝试了LTRIM和RTRIM,但结果相同。好的,我在每行前后都放置了一个点,而不是使用 SUBSTRING_INDEX 只从结果中提取名称,这样我就得到了我所需要的。 谢谢大家的回答。你确定那里有空格吗?你能提供一些示例数据吗?这对我很有用。e、 g.选择trim('a-user-name')选择修剪('a-user-name')您不需要在查询中指定表名吗?

我试图从字段中删除空格(名称前后)

但是它没有做任何事情,正如我在MySQL开发页面中看到的,查询看起来是正确的。 我遗漏了什么吗


我也尝试了LTRIM和RTRIM,但结果相同。

好的,我在每行前后都放置了一个点,而不是使用

SUBSTRING_INDEX
只从结果中提取名称,这样我就得到了我所需要的。
谢谢大家的回答。

你确定那里有空格吗?你能提供一些示例数据吗?这对我很有用。e、 g.选择trim('a-user-name')<代码>选择修剪('a-user-name')您不需要在查询中指定表名吗?
SUBSTRING_INDEX