2017년 1월 11일 수요일

save arabic text


i am connecting and saving useing this code , its not working , the result in db is ??????????????????????????????

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <?php
   $dbhost = '-------';
   $dbuser = '-----------------';
   $dbpass = '---------------';
   $conn = mysql_connect($dbhost, $dbuser, $dbpass);
   
   if(! $conn ) {
      die('Could not connect: ' . mysql_error());
   }
$name=mysql_real_escape_string($_GET['name']);
$phone=mysql_real_escape_string($_GET['phone']);
$adress=mysql_real_escape_string($_GET['adress']);
$besttimetocall=mysql_real_escape_string($_GET['besttimetocall']);

   $sql = "INSERT INTO neww 
      (name,phone,adress,besttimetocall,date) 
      VALUES ('$name','$phone','$adress','$besttimetocall',NOW())";
         
   mysql_select_db('----------------------');
   $retval = mysql_query( $sql, $conn );
   mysql_query("SET NAMES UTF8");
   if(! $retval ) {
      die('Could not enter data: ' . mysql_error());
   }
   
   echo "Entered data successfully\n";
   
   mysql_close($conn);

?>

--
see my answer in your other thread arabic
let us know, if this works for you

-- 

댓글 없음:

댓글 쓰기