Re: concatenating

From: Date: Thu, 11 Aug 2011 04:22:03 +0000
Subject: Re: concatenating
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-314484@lists.php.net to get a copy of this message
At 12:03 AM 8/11/2011, Chris Stinemetz wrote:
Is it possible to concatenate a string and an element from a mysql_fetch_assoc array? I haven't had much luck searching google. Such as concatenating "results" with ' . $posts_row['store_tptest'] . ' so that if there are no elements returned nothing will be displayed?
Sure, do something like this: <?php echo ($posts_row['store_tptest'] != '')?"results {$posts_row['stor_tptest']}:''; ?> Ken

« previous php.general (#314484) next »