+ -
当前位置:首页 → 问答吧 → ubuntu 8.10 安装Oracle 10G 企业版综合指南

ubuntu 8.10 安装Oracle 10G 企业版综合指南

时间:2010-07-29

来源:互联网

代码:
<?php
header("Content-Type:text/vnd.wap.wml; charset=utf-8");
$s="utf-8";
echo("<?xml version=\"1.0\" encoding=\"".$s."\"?>\n");
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">       
<wml>
<head>
<meta http-equiv="Cache-Control" content="max-age=0"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Expires" content="Mon, 1 Jan 1990 00:00:00 GMT"/>
</head>
<card id="card1" title="123"><p>
<?php
$conn=@mysql_connect("localhost","root","123456");
mysql_select_db("gdkyklfsdfg",$conn);
mysql_query("set names 'uft-8'");
  $str="INSERT INTO hgfkkjhkj (sgd ,lkfhyt ,vzbg ,javas ,soruc ,mark)".
  "VALUES ('熬吸档 M478','240 x 367','22/376657','','','0')";
  mysql_query($str);
mysql_close();
echo "OK!";
?> </p></card></wml>

文件保存时是utf-8编码的,数据库也是utf-8,但用上面的代码向数据库插入中文时在数据库里显示就是乱码,用phpmyadmin插入时就没问题,请问上面的代码哪里有问题?

作者: gdgglhy   发布时间: 2010-07-29

代码:
<?php
header("Content-Type:text/vnd.wap.wml; charset=utf-8");
$s="utf-8";
echo("<?xml version=\"1.0\" encoding=\"".$s."\"?>\n");
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">       
<wml>
<head>
<meta http-equiv="Cache-Control" content="max-age=0"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Expires" content="Mon, 1 Jan 1990 00:00:00 GMT"/>
</head>
<card id="card1" title="123"><p>
<?php
$conn=@mysql_connect("localhost","root","123456");
mysql_select_db("gdkyklfsdfg",$conn);
mysql_query("set names 'uft-8'");
  $str="INSERT INTO hgfkkjhkj (sgd ,lkfhyt ,vzbg ,javas ,soruc ,mark)".
  "VALUES ('熬吸档 M478','240 x 367','22/376657','','','0')";
  mysql_query($str);
mysql_close();
echo "OK!";
?> </p></card></wml>

文件保存时是utf-8编码的,数据库也是utf-8,但用上面的代码向数据库插入中文时在数据库里显示就是乱码,用phpmyadmin插入时就没问题,请问上面的代码哪里有问题?

作者: gdgglhy   发布时间: 2010-07-29

代码:
<?php
header("Content-Type:text/vnd.wap.wml; charset=utf-8");
$s="utf-8";
echo("<?xml version=\"1.0\" encoding=\"".$s."\"?>\n");
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">       
<wml>
<head>
<meta http-equiv="Cache-Control" content="max-age=0"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Expires" content="Mon, 1 Jan 1990 00:00:00 GMT"/>
</head>
<card id="card1" title="123"><p>
<?php
$conn=@mysql_connect("localhost","root","123456");
mysql_select_db("gdkyklfsdfg",$conn);
mysql_query("set names 'uft-8'");
  $str="INSERT INTO hgfkkjhkj (sgd ,lkfhyt ,vzbg ,javas ,soruc ,mark)".
  "VALUES ('熬吸档 M478','240 x 367','22/376657','','','0')";
  mysql_query($str);
mysql_close();
echo "OK!";
?> </p></card></wml>

文件保存时是utf-8编码的,数据库也是utf-8,但用上面的代码向数据库插入中文时在数据库里显示就是乱码,用phpmyadmin插入时就没问题,请问上面的代码哪里有问题?

作者: gdgglhy   发布时间: 2010-07-29