Fardin
Fardin

Reputation: 1

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

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 / 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.

Upvotes: 0

Views: 300

Answers (1)

Roadmaster
Roadmaster

Reputation: 5357

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.

Upvotes: 1

Related Questions