At 10:37 -0500 1/7/03, Lefevre, Steven wrote:
I'm developing a web-site database. There is a form on one page where a user
can search for a student by typing in a last name and submitting it.

Sometimes there can be more than one student with the same last name, so I
want the user to be able to type in "Smith, J" (where normally they type
'Smith').

The problem (as I see it) is that I'm storing the last name and the first
name in two seperate fields. I can make an SQL statement like "Select * from
Students Where LastName Like "Smith%";", but can I make something like

"SELECT * FROM Students WHERE (LastName, ", ", FirstName) AS Name LIKE
"Smith, J%";"
?
You might find the CONCAT() function useful for this.

---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to