FW: [PHP] Help please!
| From: | craig girard | Date: | Thu, 09 Nov 2000 16:55:19 +0000 |
| Subject: | FW: [PHP] Help please! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-24511@lists.php.net to get a copy of this message | ||
Wee,
I have just started using PHP, but have been using web languages for 4
years. Is the CONCAT fucntion you are trying to use a PHP function? Anyway
what you can do, and looks like you are trying to do, is do it in SQL,
therefore try this syntax...
SELECT fname + ' ' + lname AS fullname
FROM tablename
hope this helps
Craig Girard
-----Original Message-----
From: Wee Chua [mailto:Chua@mail.interclean.com]
Sent: Thursday, November 09, 2000 11:30 AM
To: MySQL (E-mail); PHP (E-mail)
Subject: [PHP] Help please!
Hi all,
I have a problem for using concat fname and lname to become fullname field
from the query, is it possible I could do the
string comparison after concat funtion, thanks a lot. I have tried the
example below but it didn't work. Could anyone tell me
is there any errors in my codes or could I do it in different way for not
repeatedly displaying fullname? Thank you very much.
for example,
$result=mysql_query("SELECT concat(fname,' ',lname) fullname, ... FROM
tablename",$db);
$data=mysql_fetch_row($result);
$data=$row('fullname');
if ($data!==$old)
{ echo "$data";
$old=$data;
} else { echo " "; }
regards;
Calvin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net