Search code examples
mysqldatabasephpmyadminstore

phpmyadmin deletes backslash and hyphen, but I don't want


I want to store some data on my phpmyadmin database. But phpmyadmin delete backslashes and hyphens in my link or text. How can i fix it ? I am using utf8_general_ci in tables.

For example this is the link I want to record

http://hurriyetemlak.cubecdn.net/image.ashx?type=4&image=Images\6\7\8\5\8\5\3\2\0e221cda-8822-4459-be59-0b8047227e2c.jpg

And here is result

http://hurriyetemlak.cubecdn.net/image.ashx?type=4&image=Images67858532e221cda-8822-4459-be59-0b8047227e2c.jpg

In this example, phpmyadmin delete backslashes after "..image=Images". And here, delete a zero before "e221cda..."

Also, I want to store an id number like this "21865-3536", but phpmyadmin convert this number to "21865". Why is this happening ?


Solution

  • This has nothing to do with phpMyAdmin per se but with MySQL's defaulting to considering backslashes as the escaping character.

    Two solutions: either,

    1. escape the backslashes in all your input (i.e. change them to \\)

    or,

    1. temporary change the SQL mode with :

      SET SESSION sql_mode = 'NO_BACKSLASH_ESCAPES';