<?
include ('conn.php');
//参数传递
if ($_GET[code]){
$_POST[bncode] = $_GET[code];
}$csql = $_POST[bncode];
if($csql) {
$asql = "select * from sdb_goods where bn = '".$csql."'";
$bsql = mysql_query($asql,$conn); while($rows=mysql_fetch_array($bsql)){
//读取商品图片路径
$pic=$rows[small_pic];
$pic=explode("|",$pic);
$apic=$pic[0];
//
//读取品牌空间对应商家的LOGO
$brand = "select * FROM gq_shopitems where subject='$rows[syjdtname]'";
$abrand = mysql_query($brand);
$cbrand=mysql_fetch_array($abrand);
//
?>
<!--页面布局开始-->
HTML页面
<!--页面布局结束-->
<?
}// while结束
}//if 结束
else{
?>
<!--页面布局开始-->
HTML页面
<!--页面布局结束-->
<?
}
?>大家帮忙看看,我该如何写这样一个判断:
如果提交的编号,经MYSQL查询后,返回空值,则在页面弹出错误。如何实现这样的效果呢?
这个应该放在哪里?我尝试了很多次,结果页面显示空白了。
if(empty($dsql)){
echo "您输入的货号有误";
}
能显示这段信息,如何使这段信息,能像弹窗一样,弹出来呢?
<?
include ('conn.php');
//参数传递
if ($_GET[code]){
$_POST[bncode] = $_GET[code];
}$csql = $_POST[bncode];
if($csql) {
$asql = "select * from sdb_goods where bn = '".$csql."'";
$bsql = mysql_query($asql,$conn);
$dsql = mysql_fetch_array($bsql);
if(empty($dsql)){
echo "您输入的货号有误";
}
while($rows=$dsql){现在是这么写的,如果查询的值是对的,就会很慢。虚拟机都卡的不行了。
$esql=mysql_num_rows($bsql);
当$esql < 1的时候 弹出对话框呢?
而不是在页面中以普通文字的形式显示错误文字呢?
0=>""
})
echo 'error';