|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
when i put a value in a field: name varchar(20)
for example d'argent, it will not be returned the same. How can i solve this? |
|
#2
|
|||
|
|||
|
quick fix
insert into Table (field) values("d'argent"); |
|
#3
|
|||
|
|||
|
i use facemySQL to insert data into mysql. It is about the same as phpMyadmin, very usefull. But one thing when i insert or update data, this is part of it's code in de forms
$value[$i]=addslashes($value[$i]); It puts in a slash when i insert something like d'argent. it returns : d'argent. Ok, i cut the addslashes part, now it does put it the way i want. But i can imagine that the addslashes part has a meaning, so what i would like is to leave the code as it originally was so when i retrieve data out of mysql i do not want to see d'argent. So i think i have to use stripslashes(). So lets say i have a field :naam Is this going to work? $naam = stripslashes($naam) But where do i put this because when i put it in the form where i have the query, it is ignored tnx |
|
#4
|
|||
|
|||
|
You shouldn't see the backslash when you remove the record. What you are experiencing is double escaping. You have magic quotes turned on so the value is automatically escaped when it is passed but then the script does it again when addslashes is used. Remove the addslashes or turn off magic quotes.
|
|
#5
|
|||
|
|||
|
php.ini at my provider caanot change this. which is the one?
magic_quotes_gpc = 1 ; magic quotes for incoming GET/POST/Cookie data magic_quotes_runtime = 0 ; magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc. magic_quotes_sybase = 0 ; Use Sybase-style magic quotes (escape ' with '' instead of ') |
|
#6
|
|||
|
|||
|
magic_quotes_gpc=0 to turn it off
|
|
#7
|
|||
|
|||
|
i do not have user rights to change this at my provider
|
|
#8
|
|||
|
|||
|
There are ways to turn on or off any php.ini properties using an .htaccess file for the directory of your script. See http://www.php.net/manual/configuration.php
The real question, though, is why turn off magic_quotes_gpc, when the way to solve your problem is to also turn on magic_quotes_runtime, which will unescape any quote characters that were escaped during a POST operation. This way, for most dynamic web operations, you don't even have to think about adding or stripping slashes. |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > field name value with special characters??how? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|