Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Handling Null

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
SteveJ
Smarty n00b


Joined: 04 Mar 2016
Posts: 3

PostPosted: Fri Mar 04, 2016 8:34 pm    Post subject: Handling Null Reply with quote

Hello bit of a newbie question, but I'm trying to handle a database field that is returning null.
Code:

{foreach from=$Grid.Row item=Cell}
{if $Cell.Caption == "Q"}{assign var=q value=$Cell.DisplayValue|default:'x'}{/if}
{/foreach}

The idea being is that if the field is null then q is set to x, but it isn't working. Is there some other function I should be using.

SteveJ[/code]
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sat Mar 05, 2016 8:44 am    Post subject: Reply with quote

Why not do that in the SQL query?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP