We help IT Professionals succeed at work.

Select where only a portion of the string is known.

Luey
Luey asked
on
Is it possible to select from a table where only a portion of the string in a column is known?
Example: I type 1234 in my form field and return all data that starts with 1234.  ie, 123456


"SELECT * FROM members WHERE mem_first_name = '$search'";

Open in new window

Comment
Watch Question

Commented:
I am not sure for my sql, perhaps there is a like clause?

Select *
from y
Where itype like '1234%'

Regards
Martin

Author

Commented:
Yes,  I ended up using LIKE
"SELECT * FROM members WHERE mem_first_name LIKE '$search%'"

Explore More ContentExplore courses, solutions, and other research materials related to this topic.