Welcome Guest, Not a member yet? Register   Sign In
Inserting Arabic text into the database problem .
#1

[eluser]3m masr[/eluser]
hi everyone , ..

i am developing a shopping cart in arabic using codeigniter and i can't insert arabic text into the db it is inserted as ???? ???? ???? i tried to alter the database ussing

Code:
ALTER DATABASE metcart COLLATE latin1_swedish_ci;

and then i changed the

Code:
$db['default']['char_set'] = "utf8";
      $db['default']['dbcollat'] = "latin1_swedish_ci";

and i sent the header

Code:
header('Content-Type: text/html; charset=utf-8');

in index.php file but it still appear as ???? ??? ??

text is also ?????? like that in the db itself .
#2

[eluser]3m masr[/eluser]
u mean that there is no way to store arabic text in the db ?
#3

[eluser]3m masr[/eluser]
thanks man , i am reading it right now , but are Chinese and Arabic the same ?
#4

[eluser]devbro[/eluser]
what is the data type in your database? it should be utf8 in order to put arabic/persian characters in the database.
#5

[eluser]3m masr[/eluser]
Code:
ALTER DATABASE metcart COLLATE latin1_swedish_ci;
#6

[eluser]devbro[/eluser]
first of all it should be "utf8_general" (check my spelling)
second of all you will need to do this for each text field in each table. Doing it for your database is a bit too late.

use phpmyadmin and it would be somewhat easier to do this.




Theme © iAndrew 2016 - Forum software by © MyBB