Hi
I've got a slight problem, I've already built up my database of users who have already entered their [ Post Code ] as one field. [d12]
I'm now in need of only using the first part of the post code in a MySQL query.
So if the post code in [ d12 ] = EC4 2XY I only want to pull EC4 from the table.
$query_userCoords = "SELECT COUNT(dest.outcode) as density, dest.outcode, dest.x, dest.y FROM drivers AS source, hwz_postcodes AS dest WHERE d12 = dest.outcode GROUP BY dest.outcode ASC";
The table is called [ drivers ] and the field is [ d12 ]
Can I change the above code to trim the result to just EC4 (assuming it was split up with a space, where some of the post codes have been entered without spaces!! ... not very helpful, but its a start.)
Just wondering if this is possible, and if so how can it be done in the above line?
If its not possible, I'll just have to re-build another field with the information I want sigh