例如
数据库字段:
jiage ? ? zhuangtai
jiage=100.00
zhuangtai=已付款或未付款
判断:
if($row['zhuangtai']=="已付款")
{
echo?"font?color=颜色值已付款/font";
}
else?if($row['zhuangtai']=="未付款")
echo?"font?color=red未付款/font";
else
echo?"付款状态错误!";
如果你的付款状态使用数字来区分的,那么只要把已付款未付款改成你区分的数字即可.
例如0为未支付,1为已支付.
if($row['zhuangtai']=="1")
else?if($row['zhuangtai']=="0")
!--{if $goods.seller_note eq ''}--
a href="javascript:addToCart({$goods.goods_id})"img src="images/bnt_cat.gif" //a
!--{else}--
a href="{$goods.seller_note}" target="_blank"img src="images/bnt_cat.gif" border="0"
//a
!--{/if}--
PHP要判断表单元素的值是否为空,首先需要提交表单,然后根据name获取表单元素,判断是否为空即可.示例如下:
php
if($_POST['sub']){
//获取文本框的内容
$content=$_POST['content'];
if($content==""){
echo?"文本框内容为空!";
}else{
echo?"文本框内容不为空!";
html
head
title演示/title
/head
body
form?name="form1"?action="?php?echo?$_SERVER['PHP_SELF'];?"?method="post"
input?type="input"?name="content"/
input?type="submit"?name="sub"?value="提交"/
/form
/body
/html
lt;?php
$username=trim($_POST['username']);
$password=trim(amp;_POST['pass']);
$query = "select * from WEB_VIEW where DNBH='$username' and 密码字段 = '$password' ";
$result = mssql_query($query) or die ("查询数据失败: ".mysql_error());
if (!mssql_num_rows($result)) {
}else {
//输出结果
哦,刚才没看清楚你的要求
根据你的要求,sql语句改一下
$query="select * from WEB_VIEW? where DNBH='$username' and 密码字段?like '%{$password}' ";
以上就是土嘎嘎小编为大家整理的php判断语句内容相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!