《》在豆瓣上的页面">《》在亚马逊(中国网站)上的页面确认添加Develo">
时间:2021-07-01 10:21:17 帮助过:12人阅读
图书录入数据处理 - 藏书
核准预览数据
/*载入预定义页面*/
include 'definevar.php';
/*全局变量*/
include 'isbn10to13.php';
/*ISBN-10与ISBN-13转换*/
include 'code2loc.php';
include 'code2lang.php';
include 'code2clssys.php';
include 'code2punit.php';
/*代码——信息转换函数组*/
echo 'ISBN-13 国际标准书号:' . $isbn . '
';
echo 'CIP 图书在版编目:' . $cip . '' . '正书名:' . $title . '
';
副书名:' . $subtitle . '
丛书名:' . $series . '
$creator1loc = code2loc($creator_loc_id1);
echo '作者1:[' . $creator1loc . ']' . $creator_1 . '
';
';
$creator2loc = code2loc($creator_loc_id2);
echo '作者2:[' . $creator2loc . ']' . $creator_2 . '
$publoc = code2loc($publoc_id);
echo '由' . $publoc . '的' . $publisher . '出版
';
';
$language = code2lang($lang_id);
echo '此' . $language . '发行版本为' . $edit_date . '第' . $edit_no . '版 ' . $version_date . '第' . $version_no . '次印刷
echo '关键词组1:' . $subj_key_1 . '—' . $subj_key_2 . '—' . $subj_key_3 . '
';
';
$clssys1 = code2clssys($clssys_id_1);
echo '关键词组2:' . $subj_key_4 . '—' . $subj_key_5 . '—' . $subj_key_6 . '
';
$clssys1 = code2clssys($clssys_id_1);
echo $clssys1 . '分类号:' . $class_no_1 . '
';
$clssys2 = code2clssys($clssys_id_2);
echo $clssys2 . '分类号:' . $class_no_2 . '
$priceunit = code2punit($punit_id);
echo '价格 ' . $price . $priceunit . ' · 藏本数量 ' . $amount . ' · 相关图书ISBN ' . $rlt_isbn . '
';
echo '备注信息' . $noteinfo . '
';
echo '数据库写入信息
';
include 'insert.php'; /*载入写入数据库模块*/
?>
Developed by SJHSTONE in 2014.
$dbc = mysqli_connect('localhost', 'mylibr', 'v3rubaGbdfSSTz88', 'libr')
or die('无法链接到MySQL数据库');
mysqli_set_charset($dbc,'utf8');
/*初始连接数据库,连接变量$dbc*/
include 'dbconnect.php';
/*开始写入请求*/
$query1 = "INSERT INTO libr_metacode (meta_isbn, meta_cip) VALUES ('$isbn', '$cip')";
$result = mysqli_query($dbc,$query1)
or die('无法写入数据块1');
$query2 = "INSERT INTO libr_title (meta_isbn, title, subtitle, series) VALUES ('$isbn', '$title', '$subtitle', $'series')";
$result = mysqli_query($dbc,$query2)
or die('无法写入数据块2');
$query3 = "INSERT INTO libr_author (meta_isbn, creator, creator_id, creatorloc_id) VALUES ('$isbn', '$creator_1', '$creator_loc_id1')";
$result = mysqli_query($dbc,$query3)
or die('无法写入数据块3');
/*作者2是否为空*/
if (!empty($creator_2)) {
$query4 = "INSERT INTO libr_author (meta_isbn, creator, creator_id, creatorloc_id) VALUES ('$isbn', '$creator_2', '$creator_loc_id2')";
$result = mysqli_query($dbc,$query4)
or die('无法写入数据块4');
}
else {
echo '无写入的作者2信息,不写入数据块4';
}
mysqli_close($dbc);