+ 16
How to add special characters in my sql database with php
I wana b add special characters in my database but don't able to add help me
4 Answers
+ 5
@Maria, what is this character you're talking about? a little more detail wouldn't hurt.
+ 3
if You use pdo try with this:
$bdd=new PDO("mysql:host=$host;dbname=$dbname", $user_db, $pass_db , array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
0
Before add you data in database, you need your variables escaping with function mysqli_real_escape_string
- 1
Just URL encode the variable by using url_encode($var);