Thanks! But as no good deed goes unpunished I will need to ask few more questions:
We are trying to build a Department site and People are divided into Faculty, Staff, Students. Currently we are in very early stage and decided (but decision could be changed) to have separate FacultyPage, StaffPage, StudentPage with the same fields, because we want to have the neither the same "fill forms" nor outputs
Right now I am trying to search just Staff by lastname. But the general idea was to search all, so external (working) php script has UNION ALL in querry, also we matched against
`lastname` LIKE '$_POST[lastname]%' AND `firstname` LIKE '$_POST[firstname]%'
(we want lastname starting from ... and firstname starting from ... (those may be empty); here lastname and firstname are fields name in DB
[quota]
I would also look at the recipe on forms if I were you. Also, the LIKE operator is not the best way to do search in MySQL. It's case sensitive and far too exact to return reliable results. I would use the MATCH and AGAINST functions and order by relevance.
[/quota]
No, we really want to order by lastname and we are looking for 'lastname' starts from not contains the string. I am not sure that you are right about case sensitivity: always worked as not case sensitive. Further
http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html says
"The following two statements illustrate that string comparisons are not case sensitive unless one of the operands is a binary string:"
mysql> SELECT 'abc' LIKE 'ABC';
mysql> SELECT 'abc' LIKE BINARY 'ABC';
Thanks in advance. Victor