php - if database id field empty hide text -


If there is no ID in the database ID 'type' then I am trying to not display the text. If there is an item 'id' in the database, then the information will be displayed as 'Type: Item type' which is fine.

The problem is that when an ID # is not in the database because no item type is selected, then the page appears on 'Type:' when I do not want to show anything.

This code below which displays the text is below.

  & lt;? If get ($ -> this-> Parameters-> ('item_type', 1) == 1 || ($-> Parameters-> get ('item_type', 1) == 2 & amp; amp; blank ($ this-> item-> type)) {? & Gt; & Lt; Strong class = "label_detailed_item" & gt; & Lt ;? Php echo jettext :: _ ('type'); ? & Gt; & Lt; / strong> & Lt; Span class = "value_detailed_item" & gt; & Lt ;? Php echo font ("/", $ this-> item-> type); ? & Gt; & Lt; / Span & gt; & Lt; Br / & gt; By & lt;? }? & Gt;   

I have tried to change using the below but the text still shows

   gt; item- & gt; type)) JText :: _ ('type'); ? & Gt;   

Any help would be appreciated.

Is it possible that $ this- & gt; The item-type may contain a space character, except empty () FALSE return.

If you are looking for an ID and the ID is always an integer, then put it on an integer.

  & lt ;? Php if (empty (integer) $ this-> item-> type) JText :: echo ('type'); ? & Gt;    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -