Add records via phpMyAdmin

I got this error http://screencast.com/t/voYwHlFZJYL7 when I tried to add records to my new columns.  How can I get it to accept the data?
frugalmuleAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Randy DownsOWNERCommented:
You are trying to add text to an integer field. Try Varchar & enter the number max of character that you expect

http://www.homeandlearn.co.uk/php/php12p3.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
frugalmuleAuthor Commented:
Thank you!

Is there anything else that should be different here?  Why Swedish?  I live in Texas.

Screenshot:  http://screencast.com/t/v8T7T6wUlCzI
0
Randy DownsOWNERCommented:
Try this

http://stackoverflow.com/questions/367711/what-is-the-best-collation-to-use-for-mysql-with-php

The main difference is sorting accuracy (when comparing characters in the language) and performance. The only special one is utf8_bin which is for comparing characters in binary format.

utf8_general_ci is somewhat faster than utf8_unicode_ci, but less accurate (for sorting). The specific language utf8 encoding (such as utf8_swedish_ci) contain additional language rules that make them the most accurate to sort for those languages. Most of the time I use utf8_unicode_ci (I prefer accuracy to small performance improvements), unless I have a good reason to prefer a specific language.

You can read more on specific unicode character sets on the MySQL manual - http://dev.mysql.com/doc/refman/5.0/en/charset-unicode-sets.html
0
Randy DownsOWNERCommented:
You should also consider indexes, keys, default values & nulls.

Your checked field would probably be better as tinyint

http://stackoverflow.com/questions/2167973/datatype-for-checkboxes-in-php

The MySQL documentation recommends using tinyint(1) for boolean values, so tinyint(1) is probably the best.

http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html

http://stackoverflow.com/questions/5134281/is-it-good-to-use-default-null
You should set them to Default:Null as if the user doesn't provide any info for that fields, they should be null obviously.

http://stackoverflow.com/questions/1315481/sql-what-exactly-do-primary-keys-and-indexes-do

Primary key is usually used to create a numerical 'id' for your records, and this id column is automatically incremented.

For example, if you have a books table with an id field, where the id is the primary key and is also set to auto_increment (Under 'Extra in phpmyadmin), then when you first add a book to the table, the id for that will become 1'. The next book's id would automatically be '2', and so on. Normally, every table should have at least one primary key to help identifying and finding records easily.

Indexes are used when you need to retrieve certain information from a table regularly. For example, if you have a users table, and you will need to access the email column a lot, then you can add an index on email, and this will cause queries accessing the email to be faster.

However there are also downsides for adding unnecessary indexes, so add this only on the columns that really do need to be accessed more than the others. For example, UPDATE, DELETE and INSERT queries will be a little slower the more indexes you have, as MySQL needs to store extra information for each indexed column. More info can be found at this page.

Edit: Yes, columns that need to be used in ORDER BY a lot should have indexes, as well as those used in WHERE.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.