开发者

on updating any field from dropdown list into MYSQL with white space, data gets truncated

开发者 https://www.devze.com 2023-01-02 02:27 出处:网络
I\'m working on PHP and MySQL. inserting data and even retriving them are all fine. when i insert any data from dropdown list works fine and i can see data correctly inserted. if i dont change any dat

I'm working on PHP and MySQL. inserting data and even retriving them are all fine. when i insert any data from dropdown list works fine and i can see data correctly inserted. if i dont change any data in the dropdown list and simply click on update button then those data having white space or 开发者_如何学Python/ get truncated. for example: red rose or red / rose after clicking on update button becomes red. this is only happens when i try to update from dropdown list otherwise from text-box or text-area i have no problem even if i use apastrophe or / or white space.


From your description it looks to me like you're ommitting quotes. Maybe you have something like:

<option value=red rose>

This won't work; you need to quote the value to look like this:

<option value="red rose">

In your PHP code perhaps:

<option value=<?= $variable ?>>

Change to:

<option value="<?= $variable ?>">

Feel free to post some concrete code and we'll be happy to go over it and help you fix it.

0

精彩评论

暂无评论...
验证码 换一张
取 消