Yamaha32088 Posted March 8, 2008 Share Posted March 8, 2008 Alright someone please tell me if I am doing this totally wrong and possibly some advice. I am making a database of buinesses in various locations of the united states. I have created one table called Businesses, In there I have created 4 fields Zip code, Business, State, City, They are all VARCHAR(255) not null. When I try to add a new row that has the same zip code it give me an error saying it already exists. I know it exists but I could probably have several hundred businesses with the same ZIP. I am assuming i need to change the type of the field to allow duplicate entries. I would like to know how to solve this and if there is a better way of going about this because I will be adding hundreds of businesses in the same ZIP, STATE, CITY all of them will be searchable from a website. Also how would I set-up a field that is capable of having html inserted so that I can query it and display the html as a working page. Quote Link to comment https://forums.phpfreaks.com/topic/95017-simple-errorr-duplicate-entry/ Share on other sites More sharing options...
tippy_102 Posted March 8, 2008 Share Posted March 8, 2008 What exactly is giving you the error that the Zip already exists? Is it your php file? Quote Link to comment https://forums.phpfreaks.com/topic/95017-simple-errorr-duplicate-entry/#findComment-486750 Share on other sites More sharing options...
Yamaha32088 Posted March 8, 2008 Author Share Posted March 8, 2008 No it was the database when i tried to add a duplicate zip but i figured it out it was because it was set for the primary key thanks for the fast response tho. Do you happen to know how I would add HTML to an entry in a row so that when i query it, it will show up as working HTML in the results. Quote Link to comment https://forums.phpfreaks.com/topic/95017-simple-errorr-duplicate-entry/#findComment-486755 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.