Is it possible to select from more than one column in sql.
What i am trying to do is build a search where if I type a first name or a last name in my search form I can retrieve data checking two different columns. Is that possible. This code does not work but it may give you an idea of what I am trying to do. I want to look in mem_first_name or mem_last_name and retrieve all that match my search.
"SELECT * FROM members WHERE mem_first_name = %s OR mem_last_name = %s"
I thought it would to. I did it a different way and it worked as well.
Thanks for you help.
"SELECT * FROM members WHERE mem_first_name = '$search_name' OR mem_last_name = '$search_name'";
Thanks for you help.
"SELECT * FROM members WHERE mem_first_name = '$search_name' OR mem_last_name = '$search_name'";