Jump to content

Why would a name field have an equal sign in it & how to search or remove


floridaflatlander

Recommended Posts

I have a zip code table and the field for city names has an equal sign in them when there are two or more names like this

 

WHITEHOUSE =

STATION

 

I've used phpmyadmin to test/play with seach using LIKE ... WHITEHOUSE STATION, WHITEHOUSE =STATION, WHITEHOUSE =\nSTATION, WHITEHOUSE = STATION,  and get no result.

 

This seems like it would mess up searches, why would they have equal signs in the city names and how would I search for something like  WHITEHOUSE STATION when it's WHITEHOUSE =

STATION?

 

There are 8,637 records with an  equal sign in the city names.

 

How can I search for a city with an equal sign in the name or can I REPLACE(remove) the equal sign and it's new line charactor(if that's what it is) like this?

 

UPDATE zip_codes set city = replace (city, ' =\n', ' ');

 

Any thoughts, thanks.

Odd

 

when I use  $q = "SELECT * FROM zip_codes WHERE city LIKE 'WHITEHOUSE =\r\nSTATION'"; on a php file page I made it works and returns  WHITEHOUSE = STATION

 

when I use WHITEHOUSE =\r\nSTATION using my phpmyadmin search it returns "returned an empty result set" and ...

 

SELECT *
FROM `zip_codes`
WHERE `city` LIKE 'WHITEHOUSE =\\r\\nSTATION'

 

with the extra back slashes in the query.

Thanks for the reply

 

The data came from here http://federalgovernmentzipcodes.us/ the smaller file, it's a csv file and I checked they're in the csv file.

 

So this is an error and isn't suppose to be like this?  Anyway I don't see why there would be an equal sign in the city field.

 

I think I can fix this easy enough, I'll be back and mark solved when done.

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.