mysql 返回整数_来自mysql的整数总是返回0

我有一些从MySQL数据库中提取数据的代码,一切都很好,日期,变量等。我遇到的问题是唯一的整数是每次返回0。

while($row = mysqli_fetch_array($result)) {

$fufilled = "1";

$flag = $row['flag'];

$shopnumb = $row['Shopnumb'];

$shoptype = $row['Shop_type'];

...$shoptype和$shopnumb都会返回正确的内容,但是每次即使数据库对于5行都有1,1,1,1,0,$标志也会返回0

CREATE TABLE `Shop_data` (

`Shopnumb` int(15) NOT NULL AUTO_INCREMENT COMMENT 'shop id number',

`flag` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=unread 0=read',

`CID` int(15) NOT NULL COMMENT 'Client this shop belongs to',

`SID` varchar(50) DEFAULT NULL COMMENT 'identifys which survey to use',

`comp_date` date DEFAULT NULL COMMENT 'Completion Date',

`sched_date` date DEFAULT NULL COMMENT 'Scheduled shop date',

`shop_comp` smallint(1) NOT NULL DEFAULT '0' COMMENT 'shopper submitted report',

`edit_comp` smallint(1) NOT NULL DEFAULT '0' COMMENT 'Report has been edited',

`return_shop` smallint(1) NOT NULL DEFAULT '0' COMMENT 'return report to shopper for editing',

`report_comp` smallint(1) NOT NULL DEFAULT '0' COMMENT 'report ready for client',

`Shop_type` varchar(50) DEFAULT NULL,

`Shoploc` varchar(100) DEFAULT NULL,

`shop_cost` decimal(10,2) DEFAULT NULL COMMENT 'Normal or adjusted cost of shop',

`shop_reimb` decimal(10,2) DEFAULT NULL COMMENT 'Shopper reimburstment cost',

`shop_pay` decimal(10,2) DEFAULT NULL COMMENT 'Total cost',

`shopper_assign` varchar(200) DEFAULT NULL COMMENT 'Identifys which shopper assigned',

PRIMARY KEY (`Shopnumb`),

UNIQUE KEY `Shopnumb` (`Shopnumb`)

) ENGINE=MyISAM AUTO_INCREMENT=2252 DEFAULT CHARSET=latin1我的查询

SELECT * FROM Shop_data WHERE CID='".$_SESSION['CID']."' AND report_comp='1' AND DATEDIFF(CURDATE(), comp_date)

如果声明

if ($flag = '0') {

echo "

    ";

} else {

echo "

   flag.png%5C%22  ";

}固定

if($ flag =='0'){

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值