RESOLVED - After fixing the items noted in this thread, I had only to erase and re-enter the field and all was well..
I have a record with a field containing an apostrophe
In mySQl, the field appears ok:
"Jimmy's House"
In datagrid, the field appears as
"Jimmy\'s House"
Is there a way to fix this?
Thanks!
English Language problem - Apostrophes - RESOLVED
Moderator: alexandrleonenko
-
- Master
- Posts: 159
- Joined: Feb 23rd, '10, 15:06
English Language problem - Apostrophes - RESOLVED
Last edited by daviddelmonte on Jun 23rd, '10, 21:24, edited 1 time in total.
-
- Site Admin
- Posts: 6016
- Joined: Jan 7th, '09, 23:18
- Contact:
Re: English Language problem - Apostrophes
No, but why you need this?
-
- Master
- Posts: 159
- Joined: Feb 23rd, '10, 15:06
Re: English Language problem - Apostrophes
Hi. the client does not want the field to look like this:
"Freddy\'s House"
"Freddy\'s House"
-
- Master
- Posts: 159
- Joined: Feb 23rd, '10, 15:06
Re: English Language problem - Apostrophes
Someone has suggested entering the following code snippet:
Code: Select all
if (get_magic_quotes_gpc()) {
function stripslashes_deep($value)
{
$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
return $value;
}
$_POST = array_map('stripslashes_deep', $_POST);
$_GET = array_map('stripslashes_deep', $_GET);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
}
Do you agree and if so, where should it go?
Thanks!!
-
- Site Admin
- Posts: 6016
- Joined: Jan 7th, '09, 23:18
- Contact:
Re: English Language problem - Apostrophes
DataGrid may store data with apostrophes and retrieve data without them. But if you need to show this data on third side, simply use something like:
str_replace("\'", "'", $data) or stripslashes() function of php
str_replace("\'", "'", $data) or stripslashes() function of php
-
- Master
- Posts: 159
- Joined: Feb 23rd, '10, 15:06
Re: English Language problem - Apostrophes
Hi. thanks for your answer. The apostrophe is wrong. If I look at the data in phpmyadmin, the apostrophe is not there.Somehow it only shows in Datagrid..
If I was to use the code you sent me (Thank you!!), where would I place the code?
If I was to use the code you sent me (Thank you!!), where would I place the code?