MySQL table dosent accept comma's?

Discussion in 'MySQL' started by Kayz, Feb 21, 2008.

  1. #1
    Hi i have a php page and all articles enter fine.

    But when i tried entering a line which had a apostrophe in it for example "can't" it fails to enter.

    I cant see what i am doing or did when i first created the table.

    This is the table:

    CREATE TABLE `article` (
    id int(4) NOT NULL auto_increment,
    firstname varchar(30) NOT NULL default '',
    surname VARCHAR(30) NOT NULL default '',
    locality VARCHAR(30) NOT NULL default '',
    username varchar(65) NOT NULL default '',
    title varchar(65) NOT NULL default '',
    article varchar(1000) NOT NULL default '',
    submission_date varchar(60) NOT NULL default '',
    PRIMARY KEY (`id`)
    ) TYPE=MyISAM AUTO_INCREMENT=2 CHARSET=latin1;


    I believe it has something to do with the charset? Well ive changed that to utf8 also but still no hope.

    Any ideas? Thanks!

    Cheers
     
    Kayz, Feb 21, 2008 IP
  2. 2WDH.com

    2WDH.com Active Member

    Messages:
    143
    Likes Received:
    3
    Best Answers:
    5
    Trophy Points:
    68
    #2
    Hi Kayz.

    Try to use the addslashes() PHP function for the new article variable before using it in MySQL query.
     
    2WDH.com, Feb 21, 2008 IP