AaronCampbell
07-09-2004, 05:45 PM
Is there any way to make order_by look at the second line in a field? The database has addresses in it like this:
132 Some Street
SomeCity, ST 99999
The thing is, I want it to order_by city, st. Would have been nice if the db was set up with seperate street_address/city/st/zip columns...
Anyway, in php I do this to the address: $row_info['address'] = preg_split('/\r\n|\n|\r/',$row_info['address']);
then I use $row_info['address'][1] anytime I want the city,st zip line. Is there anyway to make order_by do the same kind of thing?
132 Some Street
SomeCity, ST 99999
The thing is, I want it to order_by city, st. Would have been nice if the db was set up with seperate street_address/city/st/zip columns...
Anyway, in php I do this to the address: $row_info['address'] = preg_split('/\r\n|\n|\r/',$row_info['address']);
then I use $row_info['address'][1] anytime I want the city,st zip line. Is there anyway to make order_by do the same kind of thing?