How to add special characters in my sql database with php | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

27th Mar 2017, 12:06 PM
Saurav Saini
Saurav Saini - avatar
4 Answers
+ 5
@Maria, what is this character you're talking about? a little more detail wouldn't hurt.
2nd Sep 2017, 7:39 PM
Ipang
+ 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'));
19th Oct 2017, 11:42 AM
sfeuh
sfeuh - avatar
0
Before add you data in database, you need your variables escaping with function mysqli_real_escape_string
1st Sep 2017, 10:41 PM
Yuriy Stolyarov
Yuriy Stolyarov - avatar
- 1
Just URL encode the variable by using url_encode($var);
2nd Apr 2017, 5:12 PM
Vishal Prajapati