|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Feb 2009
Messaggi: 700
|
[MySql] Errore query creazione di una tabella, qualche info su come risolvere?
Allora,
ho uno script prefatto che prima di essere "installato" costruisce delle tabelle in MySql Ora...una delle tabelle viene costruita così: Codice:
DROP TABLE IF EXISTS `#__phocagallery`; CREATE TABLE `jos_phocagallery` ( `id` int(11) unsigned NOT NULL auto_increment, `catid` int(11) NOT NULL default '0', `sid` int(11) NOT NULL default '0', `title` varchar(250) NOT NULL default '', `alias` varchar(255) NOT NULL default '', `filename` varchar(250) NOT NULL default '', `description` text, `date` datetime NOT NULL default '0000-00-00 00:00:00', `hits` int(11) NOT NULL default '0', `latitude` varchar(20) NOT NULL default '', `longitude` varchar(20) NOT NULL default '', `zoom` int(3) NOT NULL default '0', `geotitle` varchar(255) NOT NULL default '', `videocode` text, `vmproductid` int(11) NOT NULL default '0', `imgorigsize` int(11) NOT NULL default '0', `published` tinyint(1) NOT NULL default '0', `approved` tinyint(1) NOT NULL default '0', `checked_out` int(11) NOT NULL default '0', `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00', `ordering` int(11) NOT NULL default '0', `params` text, `extlink1` text, `extlink2` text, `extid` varchar(255) NOT NULL default '', `extl` varchar(255) NOT NULL default '', `extm` varchar(255) NOT NULL default '', `exts` varchar(255) NOT NULL default '', `exto` varchar(255) NOT NULL default '', `extw` varchar(255) NOT NULL default '', `exth` varchar(255) NOT NULL default '', PRIMARY KEY (`id`), KEY `catid` (`catid`,`published`) ) TYPE=MyISAM CHARACTER SET `utf8`; Altre tabelle invece vengono costruite così: Codice:
DROP TABLE IF EXISTS `jos_phocagallery_votes`; CREATE TABLE `jos_phocagallery_votes` ( `id` int(11) NOT NULL auto_increment, `catid` int(11) NOT NULL default 0, `userid` int(11) NOT NULL default 0, `date` datetime NOT NULL default '0000-00-00 00:00:00', `rating` tinyint(1) NOT NULL default '0', `published` tinyint(1) NOT NULL default '0', `checked_out` int(11) unsigned NOT NULL default '0', `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00', `ordering` int(11) NOT NULL default '0', `params` text, PRIMARY KEY (`id`) ) TYPE=MyISAM DEFAULT CHARSET=utf8; Differiscono nella parte finale...cioè: la prima tabella termina con: TYPE=MyISAM CHARACTER SET `utf8`; che non crea problemi alla creazione della tabella sul mio database mentre la seconda termina con la forma: TYPE=MyISAM DEFAULT CHARSET=utf8; che invece causa quell'errore... Ora vorrei sapere....come posso risolvere quell'errore? Se nella seconda tabella sostituisco la parte finale con TYPE=MyISAM CHARACTER SET `utf8`; va bene? O devo fare qualche altra cosa? In pratica vorrei sapere se le due forme sono logicamente conclusive... Poi...altra cosa: TYPE=MyISAM sò cosa vuol dire...uso MyISAM come table engine...ma cosa è il character set? Grazie mille |
![]() |
![]() |
![]() |
#2 | |
Senior Member
Iscritto dal: Jun 2006
Città: Roccaraso (AQ) ~ Milano
Messaggi: 1355
|
Quote:
- Dovrebbe funzionare semplicemente sostituendo
__________________
PS4 - xBox360 - ATIsupporter - MBP 15" i7 - Honor 8 - Surface Pro 128Gb |
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 06:30.