View Full Version : db insert with special chars.

09-02-2009, 01:29 AM
I am inserting the following value to my db.

Coconut Crème Brûlée

When I want to delete it via a script (as opposed to using phpMyAdmin etc), the script displays it as 'Crme Brle' (without the single quotes). as a result, it cannot match what is in the db and so wil not delete it.

which is better:

1. make sure it is inputted to the db as it is and make my script match with that for deletion
2. keep my script as is and make the value in the db be in readable format.

If db value should be readable, please give me a shove as to how to do that, without an extra step such as a proffing page.

The script works correctly in all other ways. only with these types of character do I have difficulties.


09-02-2009, 05:45 AM
Further on this and I have found a gap in my knowledge.

the $Path string shows the value as Crme Brle. However, when I print it out i.e. print qq( path=$Path);

it shows this on my page Crème Brûlée

if I use my $dish = $cgi->param('dish_name'); it gives me Crme Brle

Why does $Path print out as jumble?


09-02-2009, 06:27 AM
OK, after numerous searches before knowing what I needed to search for :rolleyes:, I have the function problem resolved with

use HTML::Entities;

But I still haven't worked out why the value in the PATH_INFO is fine until I print qq( $Path ); it still outputs gobbeldeegook.