0

I have two MySQL insert statements on my site.

If I insert a £ sign into $data through this statement it goes in as a £ - which is fine.

$query = "INSERT INTO `applicants` (`id`, `data`, .....) 
VALUES ('0', '".addslashes($data )."',... "; 

In the second statement the £ in $data goes in as £ The insert statement is

$stmt = $conn->prepare('INSERT INTO applicants SET   
`data` = :data,
........  
$stmt->bindParam(':data', $data);   

Might the £ problem be caused by the way $stmt / bindParam insert statement?

Pete D
  • 311
  • 3
  • 15
  • What good is that call to ?`addslashes()` meant to do? – arkascha Jul 17 '17 at 15:12
  • Apart from that this actually looks like an encoding issue to me. Check this: https://stackoverflow.com/questions/279170/utf-8-all-the-way-through – arkascha Jul 17 '17 at 15:13
  • I've worked through the possible problem areas. It appears to be UTF-8 'all the way'. Just wondered if there might be something else I was missing. – Pete D Jul 18 '17 at 12:52

0 Answers0