Gossamer Forum
Home : General : Perl Programming :

SQL and Searching

Quote Reply
SQL and Searching
I'm trying to search my database, to display all results with the first letter of a paticual field is, for arguments sake, "G".

I've tried:

SELECT * FROM geog WHERE FIELD_TO_SEARCH LIKE '%^g%' ORDER BY $orb $limit

I know I'm going about this the wrong way, but I'm not sure how to ammend it? I probably need to get rid of the %% signs and replace them with something?

Any ideas?

Thanks

- wil
Quote Reply
Re: [Wil] SQL and Searching In reply to
Um....

SELECT * FROM geog WHERE FIELD_TO_SEARCH LIKE 'g%' ORDER BY $orb $limit

Quote Reply
Re: [RedRum] SQL and Searching In reply to
Thanks.

- wil