TP代码编写注意点(不按期更新)

 1.缓存问题:本地编写代码测试正常,上传到linux 或unix系统上,结果致使样式丢失(强制刷新就正常),这个与写css的格式或方法有关;css

   2.编码中相关变量:$pay_table_name='msc_home_pay_user_card_'.$group_code.''; 和$pay_table_name='msc_home_pay_user_card_'.$group_code.; 写法效果同样,若使用TP的连贯操做的带入变量注意:如:$card_type=M('msc_member_card')->where('shop_code='.$shop_code.'')->select();linux

该连贯操做,windos下正常,在linux下会报一下错误:把$shop_code当成字段名称 来查了数组

  1. Column not found: 1054 Unknown column 'AZ12345676' in 'where clause'

应该这样写where的条:$card_type=M('msc_member_card')->where("shop_code='.$shop_code.'")->select();缓存

直接使用数组或变量便可;测试

$card_tsype_where='shop_code='.$shop_code;编码

$card_tsype_where="shop_code="'.$shop_code."'";spa

$card_type_where['shop_code']=$shop_code;unix

$card_type=M('msc_member_card')->where($card_type_where)->select();code

 

 事件事件

SET GLOBAL event_scheduler="ON"      #开启事件
SET GLOBAL event_scheduler="OFF"     #关闭事件
#事件1(插入时间戳,更新时间):
CREATE DEFINER=`root`@`localhost`  EVENT `auto_install` ON SCHEDULE EVERY 30 SECOND STARTS '2015-11-22 00:00:00' ENDS '2015-11-23 00:00:00' ON COMPLETION PRESERVE ENABLE COMMENT 'auto_install'   DO  INSERT INTO `users` (`id`, `name`, `age`, `addtime`, `update`) VALUES (NULL, 'auto_name', 20, UNIX_TIMESTAMP(),CURRENT_TIMESTAMP)
#事件2(插入时间,更新时间):
CREATE DEFINER=`root`@`localhost` EVENT `auto_install` ON SCHEDULE EVERY 5 MINUTE STARTS '2015-11-22 00:00:00' ENDS '2015-11-23 00:00:00' ON COMPLETION PRESERVE ENABLE COMMENT 'auto_install' DO INSERT INTO `users` (`id`, `name`, `age`, `addtime`, `update`) VALUES (NULL, 'auto_name', 20, CURRENT_TIMESTAMP,CURRENT_TIMESTAMP)
相关文章
相关标签/搜索