SO whats the difference between just:
AndCode:SELECT * from table where field like bob
I've always used the second, but whats the difference?Code:SELECT * from table where field like '%bob%'
The first matches only bob. The second would match archbob or bobolink or anything with bob in the middle of it. % is a wildcard.
Actually I'm wrong. The first doesn't match anything because bob is a string and needs to be enclosed in quotes. In fact, you'll get a MySQL error.
Is essentially the same as:Code:SELECT * from table where field like 'bob'
?Code:SELECT * from table where field='bob'
So is there a select option in string that do like if you have a string like "the bob", search for entries that contain either "the" or "bob"?
SELECT * FROM table WHERE entry LIKE '%the%' OR LIKE '%bob%';
Ah right... thanks r... little overlook there...
Hi. Sorry dont understand what you mean by auto string through a string and split. Could you explain what you mean ? Cause im also learning SQL and would be glad to find out moreOriginally Posted by Archbob
you would need the PHP function explode() (or the equivelant in other languages), which puts a string into an array, split by a delimiter.Originally Posted by Archbob