Home > Backend Development > PHP Tutorial > php用sqlite存进来的是乱码

php用sqlite存进来的是乱码

WBOY
Release: 2016-06-13 11:35:39
Original
1205 people have browsed it

php用sqlite存进去的是乱码
我php写了一个插入语句,里面包含中文,后来发现存进去的是乱码,
后面我用查询语句按我中文关键字查不出来
我在插入语句要怎么设置编码
if ($_POST[submit])
 {

$db=sqlite_open("user.db");
//$sql="create table user (id int,name varchar(20),password varchar(20))";
$sql="select * from user where name=$_POST[username] and password=$_POST[password]";
//sqlite_query("set names 'GBK'");
//$sqls="select * from user";
//$queryi=sqlite_query($db,$sqli);
$query=sqlite_query($db,$sql);

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template