I would use two fields in the database, "FirstName" and "LastName". The
"LastName" should be mandatory in your input from the user. Then you can
simply extract the data with an sql statement that uses "order by
LastName". If you have a significant number of records, this will be
Nick Wilson wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>I hope someone might help me with a little puzzle...
>I have bunch of db results and one of the fields is 'name',
>I want to see if there are 2 parts to it like FirstName LastName and if
>so order by the last name.
>I can see explode() being the php function I need here but am a little
>lost as to what will happen if there is only one word in the name var.
>If someone can suggest what I might do that would be great!
>Nick Wilson // www.explodingnet.com
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.0.6 (GNU/Linux)
>-----END PGP SIGNATURE-----
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php