Advanced Search

Results 1 to 4 of 4

Thread: phpmyadmin: Part of Row is flagged red

  1. #1
    Join Date
    Oct 2012
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default phpmyadmin: Part of Row is flagged red

    I created a table in phpmyadmin called "members" and it has a row called "name" which I have it set as such:

    Name = name | Type = INT | Length/Values = 100 |

    Now when I type in "admin" in the "name" section for inserting content the type box highlights red. I click save and it turns "admin" into "0."

    Also phpmyadmin is also auto adding a Collation of "latin1_swedish_ci" to "varcar" how can I stop it from adding this or is this normal?

    phpmyadmin Version: 3.5.3 (extended features not activated)

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,623
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    why are you trying to save string data into an INT field?

    Yes, you can change the collation. Look in the [Operations] tab. You can change the DB's default charsets and collation, also.

    I always specify them when creating the table, so this is never a problem:
    Code:
    CREATE TABLE IF NOT EXISTS `tablename`(
       `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT 
       --etc., etc..
       ,PRIMARY KEY(`id`)
    ) DEFAULT CHARSET=utf8;
    
    # while setting the defaults for your whole DB is a good idea 
    #   (and setting it to utf8 is an even better idea!),
    #   setting it explicitly when you create the tables makes your code more portable.
    
    # you can specify a default collation also, 
    #   however, mysql will automatically use the default collation for the specified charset,
    #   so it's not really necessary unless you want a particular, off-the-wall collation.
    Last edited by traq; 10-22-2012 at 04:26 AM.
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

  3. #3
    Join Date
    Oct 2012
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by traq View Post
    why are you trying to save string data into an INT field?
    So a username field should be varchar? Also it was how I saw someone set up the database in their video.

    Quote Originally Posted by traq View Post

    Yes, you can change the collation. Look in the [Operations] tab.
    Yes I know this. The issue is if I do not choose anything phpmyadmin is auto doing it and sometimes when I change it it changes back to what it was previously.

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,623
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by Kage Kazumi View Post
    So a username field should be varchar?
    probably the best choice in this case. VARCHAR fields have a maximum size of 255 characters.

    Quote Originally Posted by Kage Kazumi View Post
    ...The issue is if I do not choose anything phpmyadmin is auto doing it and sometimes when I change it it changes back to what it was previously.
    it shouldn't be changing back on its own. are you sure your changes are being saved?

    Edit: A thought: are you sure you're changing the correct setting? phpmyadmin has a very prominent collation option that applies to *the connection*, and is reset every session. Make sure you're changing the option for the database itself. The surest way is to use a query.
    Code:
    ALTER TABLE `myTable`
    CHARSET utf8
    COLLATE utf8_general_ci;


    you can change the default charset/collation on a database-level basis:
    Code:
    ALTER DATABASE `myDatabase` 
    DEFAULT CHARSET utf8 
    DEFAULT COLLATE utf8_general_ci;
    Last edited by traq; 10-22-2012 at 06:09 AM.
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

Similar Threads

  1. Div swap on click - Part 2!
    By chalkywhiteface in forum JavaScript
    Replies: 6
    Last Post: 08-05-2009, 07:54 PM
  2. getting last part of URL
    By queerfm in forum PHP
    Replies: 2
    Last Post: 07-04-2009, 12:40 PM
  3. Error with part of an if statement
    By Rockonmetal in forum PHP
    Replies: 3
    Last Post: 09-07-2008, 07:06 PM
  4. Getting part of a string
    By MrSheen in forum PHP
    Replies: 10
    Last Post: 09-07-2007, 02:52 PM
  5. How do I extract a part of a string?
    By jacksont123 in forum PHP
    Replies: 30
    Last Post: 02-10-2007, 03:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •