|
Posted by peter on 05/26/07 23:31
> I've inherited a php/mysql app which sorts and displays UK postcodes.
> When sorting, it uses
> SELECT... WHERE postcode like "$postcode%"
> and for a $postcode of, say E, this works Ok except it brings to
> screen everything starting EH (for Edinburgh) *and* everything
> starting E (for East London). I need to refine this further. How do
> I bring to screen *only* those starting, say, E (for East London), S
> for Sheffield and G for Glasgow, etc?
> I think I need to be able to ignore any postcode whose second letter
> is *not* a letter but is a number or space, or blank, but I don't know
> how to do this.
You can use regular expressions in mysql queries. Which could be 1 way of
doing what you wish.
Navigation:
[Reply to this message]
|