-1

Possible Duplicate:
1064 error in CREATE TABLE … TYPE=MYISAM

I am trying to install a PHP script named php-stats, this one: http://www.php-stats.it/ that is a Php that provides information about statistic of web site.

I have used it in the past and it is pretty good.

Today I am trying to install it on my server but I have some problem

It need to be installed on the server and use the database...my problem is when it try to create the database table...go into error with many tables...

The errors have the form of the following one (this is related to one specific table):

Error executing: CREATE TABLE php_stats_cache ( user_id varchar(15) NOT NULL default '0', data int(11) NOT NULL default '0', lastpage varchar(255) NOT NULL default '0', visitor_id varchar(32) NOT NULL default '', hits tinyint(3) unsigned NOT NULL default '0', visits smallint(5) unsigned NOT NULL default '0', reso varchar(10) NOT NULL default '', colo varchar(10) NOT NULL default '', os varchar(20) NOT NULL default '', bw varchar(20) NOT NULL default '', host varchar(50) NOT NULL default '', lang varchar(8) NOT NULL default '', giorno varchar(10) NOT NULL default '', level tinyint(3) unsigned NOT NULL default '0', UNIQUE KEY user_id (user_id) ) TYPE=MyISAM Error string: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 17

I have also try to access inside the *.sql file that contains the query definition and execute the creation query table inside PHP MyAdmin, for example this query (related to the previus error):

DROP TABLE IF EXISTS php_stats_cache;
CREATE TABLE php_stats_cache (
  user_id varchar(15) NOT NULL default '0',
  data int(11) NOT NULL default '0',
  lastpage varchar(255) NOT NULL default '0',
  visitor_id varchar(32) NOT NULL default '',
  hits tinyint(3) unsigned NOT NULL default '0',
  visits smallint(5) unsigned NOT NULL default '0',
  reso varchar(10) NOT NULL default '',
  colo varchar(10) NOT NULL default '',
  os varchar(20) NOT NULL default '',
  bw varchar(20) NOT NULL default '',
  host varchar(50) NOT NULL default '',
  lang varchar(8) NOT NULL default '',
  giorno varchar(10) NOT NULL default '',
  level tinyint(3) unsigned NOT NULL default '0',
  UNIQUE KEY user_id (user_id)
) TYPE=MyISAM;

Ig I try to execute this query inside PhpMyAdmin I obtain the following error message:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 17

I also try to execute it on my local mysql server on my PC but I obtain always the same error message...

Why? What is the problem? How can I do to solve this problem?

Thank you

Andrea

0

1 Answer 1

3

Using TYPE has been deprecated and it was removed in MySQL 5.5. Use ENGINE = MYISAM instead.

CREATE TABLE php_stats_cache (....) ENGINE = MYISAM;
3
  • So...what I have to do? I have to change TYPE with ENGINE in all creation table query? Dec 25, 2012 at 23:13
  • @AndreaNobili: Yes. In fact you should already have done that a long time ago because TYPE was deprecated.
    – Mark Byers
    Dec 25, 2012 at 23:15
  • Ok, now it work well !!! This code is not mine...it belong to a PHP Script downloaded that I have to use...thank you so much Dec 25, 2012 at 23:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.