当前位置:Gxlcms > PHP教程 > phppdo连接mysql数据查询数据_PHP教程

phppdo连接mysql数据查询数据_PHP教程

时间:2021-07-01 10:21:17 帮助过:29人阅读

html代码





ansys教程




php代码

$db = new sqlite3('mysql教程itedb.db');

//获取文件2进制流
$filename = "/www.bKjia.c0m/logo.gif";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize ($filename));
fclose($handle);
//创建数据表
$db->exec('create table person (idnum text,name text,photo blob)');

$stmt = $db->prepare("insert into person values ('41042119720101001x', '张三',?)");
$stmt->bindvalue(1, $contents, sqlite3_blob);
$stmt->execute();

$pdo = new sqlite3('mysqlitedb.db');
$results = $pdo->query('select * from person');
while ($row = $results->fetcharray()) {
ob_start();
header("content-type: image/jpg");
echo $row['photo'] ;
ob_end_flush();
}

?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/630802.htmlTechArticlehtml代码 !doctype html public -//w3c//dtd xhtml 1.0 transitional//en http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml head meta htt...

人气教程排行