总结

1事件分析要正确,确保程序第一步没有错误。

 

2无论先后echo的字符都会被浏览器当做html执行。

3数据库中的表连接:不要连进无用的表。

4选定的元素

c shar 里是选定的对象的selected元素,在javascript是通过selectedindex和元素集合获得。(document.getelementbyid()selectedindex)documentgetelementbyid()。options/rowindex  

 

脚本是宏。

 

5.net webform页面中只能有一个form表单 

如果有一个服务器端,加一个客户端表单则会报回发参数错误。

 

6.ado.net读出的数据object类型。在判断前先转换对应类型。

 

7.使用随机数生成集合下标时,注意用count-1

 

8.一定注意大小写。

 

9.把调试用的方法函数全部删除后看效果,调试用的dump或echo本身可能造成bug。

 

序号$p=isset($_get['pagenum'])?$_get['pagenum']-1:0;

$_server['query_string'];url get参数字符串。

12、 find_in_set(str,strlist)

该函数用于判断 str 是否在strlist 中,如果是,作为条件,返回对应数据,如果str不在strliststrlist为空字符串,则返回值为 0

13 、group_concat(leader.name) group_concat()

 

官方:该函数返回带有来自一个组的连接的非null值的字符串结果。通俗点理解:group_concat()会计算哪些行属于同一组,将属于同一组的列按照一定的拼接规则拼接好显示出来。

形象的来说就是把列里的内容转化到了行里。

14 、按钮标签class等属性没有结束引号也会导致js失效。

15ajax提交的页面代码有错误时,会报not found

16、$.dialog()

 


function add(){
    vardialog = $.dialog({
        id:'add',
        title:'添加打印机',
        content:'url:__url__/addprinter/',
        width:'800px',
        lock:true,
        parent:this
    
});
}
function editprinter(id)
{
   vardialog=$.dialog({
    id:'editprinter',
    title:'修改打印机',
    content:'url:__url__/printeredit/id/'+id,
    windth:'800px',
    lock:true,
    parent:this
   
});
}
function del(id){

    $.dialog.confirm('确定删除该条记录?',function(){
        $.post(
                '__url__/printdel/',
                {id:id},
                function(data){
                    if(data.state==1){
                        $("#hang_"+id).remove();
                        $.dialog.tips(data.info,'1','success.gif','');
                    }else{
                        $.dialog.alert(data.info,'',this);
                    }
                }
        );
    });
   
}

 

 

17    curl

function curl_post($url, $post) {

// $post['dbname'] = get_global('zt');

$options = array(

curlopt_returntransfer => true,

curlopt_header         => false,

curlopt_post           => true,

curlopt_postfields     => $post,

);

 

$ch = curl_init($url);

curl_setopt_array($ch, $options);

$result = curl_exec($ch);

curl_close($ch);

return $result;

}

18

select group_concat(p.name) as printnames,u.userid,u.truename,u.username from wms_user_info as u left join wms_printer p on find_in_set(p.id,u.printerids)  and ( `status` = 0 ) group by u.userid limit 0,25

 

 

19

19、js访问父框架lhgdialog.min.js

var api = frameelement.api,w = api.opener;

w.document.getelementbyid('gys').value=truename;

w.document.getelementbyid('custom_id').value=cusid;

api.get(“”)id搜寻父框架

20、正则表达式获得表名

 if (preg_match('/FROM\s+([]0-9a-z_:"`.@[-]*)/is', $rs['sql'], $tableName)){

            $tableName = $tableName[1];

        }

 

 

21 、yii 分页

 

    public function actionIndex()

    {

        $brand=new Brand();

     

        $dataProvider = $brand->search();

        $count=Brand::model()->count();

        $page=new CPagination($count);

        $page->pageSize=15;

        $page->applyLimit($dataProvider->criteria);

        $list=$brand->findAll($dataProvider->criteria);

        return $this->render('index',array('list'=>$list,'pages'=>$page));

    }

22、模糊查询:以大查小

SELECT *  FROM sdb_brand where  '苹果6'   LIKE  CONCAT('%',brand_name,'%') or brand_name LIKE '%%'

SELECT *  FROM sdb_brand where  INSTR(brand_name,'苹果6') or brand_name LIKE '%%'

23、TS和NTS

TS指Thread Safety,即线程安全,一般在IIS以ISAPI方式加载的时候选择这个版本。

NTS即None-Thread Safe,一般以fast cgi方式运行的时候选择这个版本,具有更好的性能。

24、js 页面加载完成事件

  用 $(document).ready不要用直接在js标签中调用函数

<script> getOrders(1, 'goodarrearage',1);</script> 如引入相关的函数文件在此代码之后会出错。

$().on();可以解决。

25、日期间隔函数

 

date_sub(now(),interval 3month)

26 、遍历数组,调用用户函数

array_walk($deliver_info, function (&$row) {$row['time']=date('Y-m-d',$row['time']);});


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值