Inserting symbols in mysql using php -


i'm using php , mysql , have problem inserting latitude , longitude values along degree, min , sec symbols. (°,',") symbols.

i have referred several sites , tried different ways can't solve it.

first tried copying symbols , concatenating 3 user input values.

$latitude=$degree.'°'.$min.'''.$sec.'?'.'n'; 

then after executing insert query,the $latitude variable value inserted in database, symbols replaced random characters shown here.

2˚3ʼ4ˮn (data stored in database) 

then tried using html character code instead of symbols.

$latitude=$degree.'&deg'.$min.'&#8217'.$sec.'#8221'.'n'; 

but doesn't work.it displays same html characters in databse.

i don't know whether problem html entities or something.

try function:

 $result = mysqli_real_escape_string(); 

refer following link

http://php.net/manual/en/mysqli.real-escape-string.php


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -