gpt4 book ai didi

Mysql表记录显示歪了

转载 作者:行者123 更新时间:2023-11-29 09:54:13 24 4
gpt4 key购买 nike

我在MySQL中创建了一个表,但是当我显示该表时,有些记录显示歪斜。

这是显示的表格:

select * from air_passenger_profile;

+------------+----------+------------+-----------+---------------------------------+---------------+---------------------+
| profile_id | password | first_name | last_name | address | mobile_number | email_id |
+------------+----------+------------+-----------+---------------------------------+---------------+---------------------+
| PFL001 | PFL001 | LATHA | SANKAR | 123 BROAD CROSS ST,CHENNAI-48 | 9876543210 | LATHA@GMAIL.COM |
| PFL002 | PFL002 | ARUN | PRAKASH | 768 2ND STREET,BENGALURU-20 | 8094564243 | ARUN@AOL.COM |
| PFL003 | PFL003 | AMIT | VIKARAM | 43 5TH STREET,KOCHI-84 | 9497996990 | AMIT@AOL.COM |
| PFL004 | PFL004 | AARTHI | RAMESH | 343 6TH STREET,HYDERABAD-76 | 9595652530 | AARTHI@GMAIL.COM |
| PFL005 | PFL005 | SIVA | KUMAR | 125 8TH STREET,CHENNAI-46 | 9884416986 | SIVA@GMAIL.COM |
| PFL006 | PFL006 | RAMESH | BABU | 109 2ND CROSS ST,KOCHI-12 | 9432198760 | RAMESH@GMAIL.COM |
| PFL007 | PFL007 | GAYATHRI | RAGHU | 23 2ND CROSS ST,BENGALURU-12 | 8073245678 | GAYATHRI@GMAIL.COM |
| PFL008 | PFL008 | GANESH | KANNAN | 45 3RD ST,HYDERABAD-21 | 9375237890 | GANESH@GMAIL.COM |
+------------+----------+------------+-----------+---------------------------------+---------------+---------------------+

最佳答案

您将其放入数据库中并添加空格。将变量插入数据库时​​,可以使用 PHP 的 trim()函数,或MySQL's ,以不带空格的方式存储它。

要更正您当前的值:

UPDATE air_passenger_profile SET first_name = TRIM(first_name), etc...

关于Mysql表记录显示歪了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54180341/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com