$query = "CREATE TABLE 'one' ( 'numer' text NOT NULL, 'mass' text NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8"; mysql_query ($query); 

I try this, but it does not work

  • one
    mistake in the studio. - zenith
  • 3
    Try replacing quotes with `CREATE TABLE one (NOT null text NOT NULL, mass text NOT NULL) ENGINE = MyISAM DEFAULT CHARSET = utf8; - alexandr
  • in addition to the previous comment: mysql_query ("CREATE TABLE one ( numer text NOT NULL, mass text NOT NULL) ENGINE = MyISAM DEFAULT CHARSET = utf8;"); - IVsevolod
  • and now it turns out that no database is selected lol - zenith
  • DB is selected, other requests for standards pass, I will try to replace the quotes - shol

1 answer 1

Instead of single quotes, you should use back quotes. In MySQL, they are designed to frame the names of tables and columns. Thus, you can use reserved words as names without fear that the analyzer will not be able to correctly parse the SQL query.

 CREATE TABLE `one` ( `numer` text NOT NULL, `mass` text NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;