<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

织梦cms 字段为空时显示不同的内容

时间:2020-12-15

有时候织梦自定义字段,如果没有值的时候要显示指定的默认内容,该如何操作那,织梦模板专家-织梦58告诉您:

{dede:field name='fujian' runphp='yes'} 
     if(@me=='')
    { @me = '' ;}  
          else
          { @me = "<div class='cr12'><a href='/.@me'>红色是自定义的内容</a></div>"; }
 {/dede:field}

 

{dede:field.image runphp='yes'}

 

 if(@me<>''){

    @me="<div5>";

}

else{

     @me="<div6>";

}

  {/dede:field.image}

 

mysql查询字段不为空的记录

 

查询不为空的所有记录

SELECT id,firstname,lastname,mail FROM testdb.users WHERE mail!='';

或者

SELECT id,firstname,lastname,mail FROM testdb.users WHERE LENGTH(mail)>0;

查询一个表的记录的总数

SELECT count(*) FROM table_name;

或者

SELECT count(*) as num FROM table_name;

0
首页
案例
关于
联系