I can get the first two letters of the $search string by using the code below substr but how do I get the first two letters of the postcode.
So SELECT all from directory where the first two letters of postcode = the first two letters of $search
$dir = substr("$search",0,2);
$directory = "SELECT * FROM directory WHERE postcode LIKE '$dir' AND authorised LIKE 'Y'";
As this is set up at the moment its looking for a postcode to have just two letters and not just looking at the first two letters