Re: verify another flavor

From: Date: Sat, 07 Mar 2009 07:19:59 +0000
Subject: Re: verify another flavor
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-289520@lists.php.net to get a copy of this message
On Fri, Mar 06, 2009 at 10:49:12AM -0600, haliphax wrote: <snip> > > 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; or $name = "$first_name $last_name"; Paul -- Paul M. Foster

« previous php.general (#289520) next »