Re: concatenating

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux