2 Star 2 Fork 4

Tody_Guo/php_issue

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
img_query.php 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
jiahui.guo 提交于 2019-05-30 08:57 . update issue tracking system
<?php
echo ":: loading config...\r\n";
extract($_POST);
extract($_GET);
unset($_POST,$_GET);
if(isset($pn)){
$con = mysql_connect('localhost', 'root', 'root');
if (!$con){
die('Could not connect: ' . mysql_error());
}
if (!mysql_select_db('image', $con)){
die('ERROR: ' . mysql_error());
}
mysql_query("SET NAMES 'UTF8'");
$result = mysql_query("select * from imagelist where `PC_PN`='${pn}'", $con);
$num = mysql_num_rows($result);
if ($num == 1){
$row = mysql_fetch_assoc($result);
echo "set PC_PN=${row['PC_PN']}\r\n";
echo "set IMG_PATH=${row['IMG_PATH']}\r\n";
echo "set IMG_SCRIPT=${row['IMG_SCRIPT']}\r\n";
echo "set IMG_TYPE=${row['IMG_TYPE']}\r\n";
echo "set HAS_SSD1=${row['HAS_SSD1']}\r\n";
echo "set HAS_SSD2=${row['HAS_SSD2']}\r\n";
echo "set HAS_HDD=${row['HAS_HDD']}\r\n";
echo "set ERRCODE=0\r\n";
}else if($num > 1){
echo "ERROR: Part number more than 1 record";
echo "set ERRCODE=1\r\n";
}else{
echo "ERROR: No Part number was found";
echo "set ERRCODE=1\r\n";
}
mysql_close($con);
}else{
echo "ERROR: No Part number was set";
echo "set ERRCODE=1\r\n";
}
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/tody_guo/php_issue.git
git@gitee.com:tody_guo/php_issue.git
tody_guo
php_issue
php_issue
master

搜索帮助