Visualizzazione risultati 1 fino 4 di 4

Discussione: problema con mysql

  1. #1
    Guest

    Post problema con mysql

    ragazzi quando carico alcune tabelle mi da un paio di errori ecco qui
    Codice:
    Errore
    Query SQL:
    
    CREATE TABLE IF NOT EXISTS `users` ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, hash char(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '', name VARCHAR(50) NOT NULL DEFAULT '', surname VARCHAR(75) NOT NULL DEFAULT '', salt CHAR(3) NOT NULL DEFAULT '', passw VARCHAR(32) NOT NULL DEFAULT '', login VARCHAR(50) NOT NULL DEFAULT '', email VARCHAR(64) NOT NULL DEFAULT '', status VARCHAR(500) NOT NULL DEFAULT '', country VARCHAR(30) NOT NULL DEFAULT '', country_id INT(10) UNSIGNED DEFAULT 0, city VARCHAR(50) NOT NULL DEFAULT '', city_id INT(10) UNSIGNED DEFAULT 0, vk_page VARCHAR(150) NOT NULL DEFAULT '', fb_page VARCHAR(150) NOT NULL DEFAULT '', my_page VARCHAR(150) NOT NULL DEFAULT '', phone VARCHAR(30) NOT NULL DEFAULT '', verify SMALLINT(6) UNSIGNED DEFAULT 0, removed SMALLINT(6) UNSIGNED D[...]
    
    Messaggio di MySQL: Documentazione
    
    #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 '")
            CREATE TABLE IF NOT EXISTS `ask_data` (
                                    id int(11) UNSIGNED NOT NUL' at line 51
    Codice:
    
    CREATE TABLE IF NOT EXISTS `users` (
    								  id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    								  hash char(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
    								  name VARCHAR(50) NOT NULL DEFAULT '',
    								  surname VARCHAR(75) NOT NULL DEFAULT '',
    								  salt CHAR(3) NOT NULL DEFAULT '',
    								  passw VARCHAR(32) NOT NULL DEFAULT '',
    								  login VARCHAR(50) NOT NULL DEFAULT '',
    								  email VARCHAR(64) NOT NULL DEFAULT '',
    								  status VARCHAR(500) NOT NULL DEFAULT '',
    								  country VARCHAR(30) NOT NULL DEFAULT '',
    								  country_id INT(10) UNSIGNED DEFAULT 0,
    								  city VARCHAR(50) NOT NULL DEFAULT '',
    								  city_id INT(10) UNSIGNED DEFAULT 0,
    								  vk_page VARCHAR(150) NOT NULL DEFAULT '',
    								  fb_page VARCHAR(150) NOT NULL DEFAULT '',
    								  my_page VARCHAR(150) NOT NULL DEFAULT '',
    								  phone VARCHAR(30) NOT NULL DEFAULT '',
    								  verify SMALLINT(6) UNSIGNED DEFAULT 0,
    								  removed SMALLINT(6) UNSIGNED DEFAULT 0,
    								  old_id SMALLINT(6) UNSIGNED DEFAULT 0,
    								  vk_id INT(10) UNSIGNED DEFAULT 0,
    								  fb_id VARCHAR(30) NOT NULL DEFAULT '',
    								  tw_id INT(10) UNSIGNED DEFAULT 0,
    								  regtime INT(10) UNSIGNED DEFAULT 0,
    								  lasttime INT(10) UNSIGNED DEFAULT 0,
    								  answers_count INT(11) UNSIGNED DEFAULT 0,
    								  perks_count INT(11) UNSIGNED DEFAULT 0,
    								  rating INT(11) UNSIGNED DEFAULT 0,
    								  balance INT(11) UNSIGNED DEFAULT 5,
    								  rating_plus INT(10) UNSIGNED DEFAULT 0,
    								  rating_minus INT(10) UNSIGNED DEFAULT 0,
    								  sex SMALLINT(6) UNSIGNED DEFAULT 0,
    								  photo_time INT(10) UNSIGNED DEFAULT 0,
    								  cover_time INT(10) UNSIGNED DEFAULT 0,
    								  last_notify_view INT(10) UNSIGNED DEFAULT 0,
    								  last_answers_view INT(10) UNSIGNED DEFAULT 0,
    								  last_messages_view INT(10) UNSIGNED DEFAULT 0,
    								  last_qa_view INT(10) UNSIGNED DEFAULT 0,
    								  last_feed_view INT(10) UNSIGNED DEFAULT 0,
    								  lang CHAR(10) NOT NULL DEFAULT 'ru',
    								  ip_addr CHAR(32) NOT NULL DEFAULT '',
    								  disable_msg SMALLINT(6) UNSIGNED NOT NULL DEFAULT 0,
    								  disable_stream SMALLINT(6) UNSIGNED NOT NULL DEFAULT 0,
    								  disable_qa SMALLINT(6) UNSIGNED NOT NULL DEFAULT 0,
    								  disable_ask SMALLINT(6) UNSIGNED NOT NULL DEFAULT 0,
    								  send_msg_false SMALLINT(6) UNSIGNED NOT NULL DEFAULT 0,
    								  send_ask_false SMALLINT(6) UNSIGNED NOT NULL DEFAULT 0,
    								  photo_url VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
    								  cover_url VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
      								PRIMARY KEY  (id), UNIQUE KEY (login)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci")
    Ultima modifica di karl94 : 17-04-2014 alle ore 20.22.38

  2. #2
    Guest

    Predefinito

    Codice:
    CREATE TABLE IF NOT EXISTS `ask_data` (
    								id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								ask varchar(600) DEFAULT NULL,
    								lang char(3) DEFAULT '',
    								standart smallint(3) UNSIGNED DEFAULT NULL,
    								time int(10) UNSIGNED DEFAULT NULL,
    								ip_addr CHAR(32) NOT NULL DEFAULT '',
    								PRIMARY KEY  (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `notify_data`( 
    								id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								to_id int(11) UNSIGNED NOT NULL DEFAULT 0,
    								cat smallint(3) UNSIGNED DEFAULT 0,
    								notify_id int(11) UNSIGNED NOT NULL DEFAULT 0,
    								time int(10) UNSIGNED DEFAULT NULL,
    								PRIMARY KEY  (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `offer_data` (
    								id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								ask_id int(11) UNSIGNED NOT NULL DEFAULT 0,
    								from_id int(11) UNSIGNED NOT NULL DEFAULT 0,
    								answers_count smallint(3) UNSIGNED DEFAULT 0,
    		CREATE TABLE IF NOT EXISTS `robot_data` (
    								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								ip_addr CHAR(32) NOT NULL DEFAULT '',
    								last_action INT(11) UNSIGNED NOT NULL DEFAULT 0,
    								count_action INT(11) UNSIGNED NOT NULL DEFAULT 0,
    								all_actions INT(11) UNSIGNED NOT NULL DEFAULT 0,
    								user_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
    								PRIMARY KEY  (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `blocked_data` ( 
    								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								ip_addr CHAR(32) NOT NULL DEFAULT '',
    								blocked_time INT(11) UNSIGNED NOT NULL DEFAULT 0,
    		CREATE TABLE IF NOT EXISTS `gifts` (
      								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
      								url VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
      								price INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								time INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								PRIMARY KEY (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `gifts_data` (
      								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
      								gift_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								from_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								to_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								hide INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								msg_data VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
      								time INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								PRIMARY KEY (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `payment_data` (
      								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
      								action INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								from_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								to_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								hide INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								msg_data VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
      								time INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								PRIMARY KEY (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `url_data` (
      								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
      								user_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								url VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
      								time INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								PRIMARY KEY (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `refs_data` (
      								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
      								ref_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								to_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								time INT(11) UNSIGNED NOT NULL DEFAULT 0,
      		CREATE TABLE IF NOT EXISTS `msg_data` (
      								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
      								from_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								to_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								msg_hash char(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
      								msg_data VARCHAR(700) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
      								time INT(11) UNSIGNED NOT NULL DEFAULT 0,
      								hide_from_id SMALLINT(6) UNSIGNED NOT NULL DEFAULT 0,
      								hide_to_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
    								photo_url VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
    								video_url VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
      								PRIMARY KEY (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `black_list` (
    								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								from_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
    								block_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
    								time INT(11) UNSIGNED DEFAULT 0,
    
    CREATE TABLE IF NOT EXISTS `ask_like` (
    							  	id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    							  	to_ask_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
    							  	to_ask_hash char(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
    							  	from_user_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
    							  	to_user_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
    							  	hide SMALLINT(6) UNSIGNED NOT NULL DEFAULT 0,
    							  	time INT(11) UNSIGNED NOT NULL DEFAULT 0,
    							  	PRIMARY KEY (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `questions` (
    								id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								ask_id varchar(600) DEFAULT NULL,
    								ask_hash char(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
    								reply_lang VARCHAR(10) DEFAULT '',
    								answer varchar(600) DEFAULT '',
    								to_id int(11) UNSIGNED DEFAULT NULL,
    								from_id int(11) UNSIGNED DEFAULT NULL,
    								hide_id int(11) UNSIGNED DEFAULT 0,
    								time int(11) UNSIGNED DEFAULT NULL,
    								photo_url VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
    								video_url VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
    								PRIMARY KEY  (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `album_data` (
    								id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								user_id varchar(600) DEFAULT NULL,
    								comment varchar(600) DEFAULT '',
    								time int(11) UNSIGNED DEFAULT NULL,
    								access int(11) UNSIGNED DEFAULT NULL,
    								type int(11) UNSIGNED DEFAULT NULL,
    								photo_url VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
    								PRIMARY KEY  (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `comments` (
    								id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								ask_id varchar(600) DEFAULT NULL,
    								comment varchar(600) DEFAULT '',
    								to_id int(11) UNSIGNED DEFAULT NULL,
    								from_id int(11) UNSIGNED DEFAULT NULL,
    								hide int(11) UNSIGNED DEFAULT 0,
    								time int(11) UNSIGNED DEFAULT NULL,
    								ip_addr CHAR(32) NOT NULL DEFAULT '',
    								PRIMARY KEY  (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `support_data` (
    								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								from_id INT(11) UNSIGNED DEFAULT 0,
    								ticket_time INT(11) UNSIGNED DEFAULT 0,
    								reply_time INT(11) UNSIGNED DEFAULT 0,
    								email CHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
    								ticket VARCHAR(600) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
    								reply VARCHAR(600) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
    								ip_addr CHAR(32) NOT NULL DEFAULT '',
    								PRIMARY KEY  (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `answer_report_data` (
    								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								answer_id INT(11) UNSIGNED DEFAULT 0,
    								from_id INT(11) UNSIGNED DEFAULT 0,
    								level INT(11) UNSIGNED DEFAULT 0,
    								time INT(11) UNSIGNED DEFAULT 0,
    								count INT(11) UNSIGNED DEFAULT 0,
    								ip_addr CHAR(32) NOT NULL DEFAULT '',
    		CREATE TABLE IF NOT EXISTS `users_report_data` ( 
    								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								user_id INT(11) UNSIGNED DEFAULT 0,
    								from_id INT(11) UNSIGNED DEFAULT 0,
    								level INT(11) UNSIGNED DEFAULT 0,
    								time INT(11) UNSIGNED DEFAULT 0,
    								count INT(11) UNSIGNED DEFAULT 0,
    								ip_addr CHAR(32) NOT NULL DEFAULT '',
    								PRIMARY KEY  (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `admin` (
    								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								mode SMALLINT(11) UNSIGNED DEFAULT 1,
    								time INT(11) UNSIGNED DEFAULT 0,
    								name CHAR(50) DEFAULT '',
    								salt CHAR(3) DEFAULT '',
    								passw CHAR(32) DEFAULT '',
    								login CHAR(32) DEFAULT '',
    								ip_addr CHAR(32) NOT NULL DEFAULT '',
    								PRIMARY KEY (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `friends_data` (
    								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								friend_id INT(11) UNSIGNED DEFAULT 0,
    								friend_to_id INT(11) UNSIGNED DEFAULT 0,
    								time INT(11) UNSIGNED DEFAULT 0,
    								PRIMARY KEY (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci");
    		CREATE TABLE IF NOT EXISTS `db_watch` (
    								id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    								user_id INT(11) UNSIGNED DEFAULT 0,
    								request CHAR(150) DEFAULT '',
    								ip_addr CHAR(32) NOT NULL DEFAULT '',
    								time INT(11) UNSIGNED DEFAULT 0,
    								PRIMARY KEY (id)) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci
    grazie mille se mi aiutate
    Ultima modifica di karl94 : 17-04-2014 alle ore 20.23.02

  3. #3
    L'avatar di LastWings
    LastWings non è connesso AlterGuru
    Data registrazione
    14-10-2006
    Messaggi
    1,628

    Predefinito

    Carichi un .sql (o esegui da phpmyadmin), o sono in uno script php?
    Perché vedo che infondo a quasi tutte, c'è ");, che però non vedo aperto.

    Se sono caricate direttamente, allora quel "); va cambiato in ;
    Codice:
    CREATE TABLE.... ;
    se tramite script php, controlla che venga aperto

    Codice PHP:
    $table = ("CREATE TABLE...");

    Alcune tabelle invece, mancano di una chiave primaria;

    offer_data, refs_data, black_list, answer_report_data mancano della parentesi di chiusura.

    Eseguile una per una, e man mano correggi gli errori che mysql ti indica
    Ultima modifica di LastWings : 17-04-2014 alle ore 21.05.33
    Ecchi Paradise - Frammenti Perduti - Semplici Parole - Recensioni ed Opinioni

    Non contattatemi privatamente per ricevere supporto, per queste cose esiste il forum pubblico
    .

  4. #4
    Guest

    Predefinito

    grazie mille ora lo metto apposto, comunque si era in uno script ma non funzionava

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •