On Fri, Mar 06, 2009 at 10:49:12AM -0600, haliphax wrote:


> I would go about it like this:
> $sql1 = "select concat_ws(' ', first_name, last_name) as Author_Name
> from author where first_name = '$first_nameIN' and last_name =
> '$last_nameIN'";

If you already know the first_name and last_name and you're just
checking for their existence, then just query for some simple field like
"id". Then check for number of rows. If it's zero, it's not there.
There's no point in making MySQL return a value which you already know.

What is the fascination with using concat_ws()? Just say:

$name = $first_name . ' ' . $last_name;


$name = "$first_name $last_name";


Paul M. Foster

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

Reply via email to