4 Replies - 263 Views - Last Post: 19 June 2014 - 01:26 PM Rate Topic: -----

#1 Desertt  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 91
  • Joined: 27-October 13

My sql arabic value

Posted 18 June 2014 - 02:18 PM

Hi i have this database
Name varchar(100) utf8_general_ci
Address varchar(200) utf8_general_ci
and this is the php and html
<html>
<body>
<form method="POST" action="DeleteLater.php">
<input type="text" name="Name" palceholder="Name"></br>
<input type="text" name="Address" palceholder="Address"></br>
<input type="submit" name="submit">
</form>
</body>
</html>


and this is the php
<?php
include("Config.php");

$table = 'publ';
		mysql_query("SET NAMES 'utf8'"); 
		mysql_query('SET CHARACTER SET utf8');
// If user pressed submit in one of the forms
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
    // cleaning Milage field
		
		$Name = $_POST['Name'];
		$Address = $_POST['Address'];

                mysql_query("INSERT INTO {$table}
                                SET
								 Name='$Name', 
								Address='$Address'");
								
}
?>



But the value saved in the database are
دار العل... بيروت
how can i save the value in the proper way i mean to save the value in arabic
any help

Is This A Good Question/Topic? 0
  • +

Replies To: My sql arabic value

#2 ArtificialSoldier  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 424
  • View blog
  • Posts: 1,546
  • Joined: 15-January 14

Re: My sql arabic value

Posted 18 June 2014 - 02:47 PM

Quote

But the value saved in the database are
دار العل... بيروت
how can i save the value in the proper way i mean to save the value in arabic

What exactly is the problem? What is supposed to get saved, and what actually gets saved?
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3593
  • View blog
  • Posts: 12,365
  • Joined: 12-December 12

Re: My sql arabic value

Posted 18 June 2014 - 02:50 PM

I don't know much about this but I suspect that you need to specify the character-set that the form can submit:
<form accept-charset="UTF-8">

You may have to specify this elsewhere as well but someone else will have to advise you about that.

I think this is actually the default for HTML5, but you haven't supplied a DOCTYPE.

This post has been edited by andrewsw: 18 June 2014 - 02:52 PM

Was This Post Helpful? 0
  • +
  • -

#4 Sheepings  Icon User is offline

  • D.I.C Addict

Reputation: 71
  • View blog
  • Posts: 565
  • Joined: 05-December 13

Re: My sql arabic value

Posted 19 June 2014 - 06:11 AM

Likely issue will come down to your database table structure. Enter the table structure for where you want to insert / update data and under ' Collation ', you will need to find an appropriate language handler for the symbols of your language used. Change your Collation to one of these: Arabic_CI_AI_KS or Latin1_General should work.
Was This Post Helpful? 0
  • +
  • -

#5 Desertt  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 91
  • Joined: 27-October 13

Re: My sql arabic value

Posted 19 June 2014 - 01:26 PM

Thank you Andrewsw it worked for me
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1