Hi I am sure this is a common thing and got a simple answer but its friday and i am clearly not got the brain power for it today.
I am wanting to do a alphabet search on a table but exclude the starting 'the ';
so say i have entrys like this.
name
'the world'
'transworld'
So I have this query $letter is the var getting passed.
SELECT blah WHERE name LIKE '$letter%' OR name LIKE 'the $letter%'
So if $letter = 'w' then 'the world' is correctly selected
BUT if $letter = 't' then 'transworld' is correctly selected but 'the world' is wrongly selected.
So I need somehting that says make sure the fourth letter is $letter. But I dont know how to actulally say that.
Is that cllear?
Thanks in advance
I am wanting to do a alphabet search on a table but exclude the starting 'the ';
so say i have entrys like this.
name
'the world'
'transworld'
So I have this query $letter is the var getting passed.
SELECT blah WHERE name LIKE '$letter%' OR name LIKE 'the $letter%'
So if $letter = 'w' then 'the world' is correctly selected
BUT if $letter = 't' then 'transworld' is correctly selected but 'the world' is wrongly selected.
So I need somehting that says make sure the fourth letter is $letter. But I dont know how to actulally say that.
Is that cllear?
Thanks in advance