ciao a tutti, sto usando questo semplice scriptino
Codice PHP:
<?php
include_once("config.inc.php");
$db = @mysql_connect($hostname,$username,$password);
mysql_select_db($database,$db);
$query = "CREATE TABLE `ratatuiaFS_cartelle` (
`id` tinyint(4) unsigned NOT NULL auto_increment,
`nome` varchar(255) NOT NULL default '',
`cartella` tinyint(4) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
CREATE TABLE `ratatuiaFS_commenti` (
`id` int(5) unsigned NOT NULL auto_increment,
`file` tinyint(5) unsigned NOT NULL default '0',
`commento` text NOT NULL,
PRIMARY KEY (`id`),
KEY `file` (`file`)
) TYPE=MyISAM;
CREATE TABLE `ratatuiaFS_files` (
`id` int(5) unsigned NOT NULL auto_increment,
`file_name` varchar(255) NOT NULL default '',
`file_size` int(10) unsigned NOT NULL default '0',
`file_type` varchar(50) NOT NULL default '',
`data` timestamp(14) NOT NULL,
`cartella` varchar(5) NOT NULL default '',
`utente` smallint(5) unsigned NOT NULL default '0',
`hits` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `utente` (`utente`)
) TYPE=MyISAM;
CREATE TABLE `ratatuiaFS_utenti` (
`id` smallint(5) unsigned NOT NULL auto_increment,
`utente` varchar(255) NOT NULL default '',
`email` varchar(255) NOT NULL default '',
`password` varchar(32) NOT NULL default '',
`lettura` char(1) NOT NULL default '',
`login` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `username` (`password`)
) TYPE=MyISAM;";
mysql_query($query,$db) or die(mysql_error($db));
$messaggio = "Le tabelle sono state inserite correttamente nel database";
}
?>
ebbene, nonostante questo dump sia stato creato con phpmyadmin mi dà questo errore
You have an error in your SQL syntax near '; CREATE TABLE `ratatuiaFS_commenti` ( `id` int(5) unsigned NOT NULL auto_increm' at line 1
solo che non riesco a capire cosa caspio sia
la stessa query, in phpmyadmin, funziona...