[HELP]MySQL error
#1

Hi,i'm new in MySQL,i am using WAMP,phpMyAdmin gives me error.
Код:
SQL query:

USE `sampnights` CREATE TABLE IF NOT EXISTS `hesaplar` (
`Id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`Isim` VARCHAR( 50 ) COLLATE latin1_general_ci NOT NULL ,
`Sifre_Hash` INT( 11 ) NOT NULL ,
`Kayitli` INT( 11 ) NOT NULL ,
`SonGiris` INT( 11 ) NOT NULL ,
`Para` INT( 11 ) NOT NULL ,
`Oldurme` INT( 11 ) NOT NULL ,
`Olum` INT( 11 ) NOT NULL ,
`Saat` INT( 11 ) NOT NULL ,
`Dakika` INT( 11 ) NOT NULL ,
`Saniye` INT( 11 ) NOT NULL ,
`AdminLevel` INT( 11 ) NOT NULL ,
`OyunSure` INT( 11 ) NOT NULL ,
`Skor` INT( 11 ) NOT NULL ,
`Orgut` INT( 11 ) NOT NULL ,
`Lider` INT( 11 ) NOT NULL ,
`Rutbe` INT( 11 ) NOT NULL ,
`EskiOldurme` INT( 11 ) NOT NULL ,
`EskiOlum` INT( 11 ) NOT NULLT,
`Aranma` INT( 11 ) NOT NULL ,
`Bankapara` INT( 11 ) NOT NULL ,
) ENGINE = MYISAM DEFAULT CHARSET = latin1 COLLATE = latin1_general_ci AUTO_INCREMENT =1;

MySQL output:
#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 `hesaplar` (`Id` INT(11) NOT NULL AUTO_INCREMENT,`Isi' at line 1
It's my ".sql" file :
Код:
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
use `sampnights`
CREATE TABLE IF NOT EXISTS `hesaplar` 
(
`Id` INT(11) NOT NULL AUTO_INCREMENT,
`Isim` VARCHAR(50) COLLATE latin1_general_ci NOT NULL,
`Sifre_Hash` INT(11) NOT NULL,
`Kayitli` INT(11) NOT NULL,
`SonGiris` INT(11) NOT NULL,
`Para` INT(11) NOT NULL,
`Oldurme` INT(11) NOT NULL,
`Olum` INT(11) NOT NULL,
`Saat` INT(11) NOT NULL,
`Dakika` INT(11) NOT NULL,
`Saniye` INT(11) NOT NULL,
`AdminLevel` INT(11) NOT NULL,
`OyunSure` INT(11) NOT NULL,
`Skor` INT(11) NOT NULL,
`Orgut` INT(11) NOT NULL,
`Lider` INT(11) NOT NULL,
`Rutbe` INT(11) NOT NULL,
`EskiOldurme` INT(11) NOT NULL,
`EskiOlum` INT(11) NOT NULLT,
`Aranma` INT(11) NOT NULL,
`Bankapara` INT(11) NOT NULL,
)ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;
Reply
#2

Quote:

SQL query:

USE `sampnights` CREATE TABLE IF NOT EXISTS `hesaplar` (
`Id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`Isim` VARCHAR( 50 ) COLLATE latin1_general_ci NOT NULL ,
`Sifre_Hash` INT( 11 ) NOT NULL ,
`Kayitli` INT( 11 ) NOT NULL ,
`SonGiris` INT( 11 ) NOT NULL ,
`Para` INT( 11 ) NOT NULL ,
`Oldurme` INT( 11 ) NOT NULL ,
`Olum` INT( 11 ) NOT NULL ,
`Saat` INT( 11 ) NOT NULL ,
`Dakika` INT( 11 ) NOT NULL ,
`Saniye` INT( 11 ) NOT NULL ,
`AdminLevel` INT( 11 ) NOT NULL ,
`OyunSure` INT( 11 ) NOT NULL ,
`Skor` INT( 11 ) NOT NULL ,
`Orgut` INT( 11 ) NOT NULL ,
`Lider` INT( 11 ) NOT NULL ,
`Rutbe` INT( 11 ) NOT NULL ,
`EskiOldurme` INT( 11 ) NOT NULL ,
`EskiOlum` INT( 11 ) NOT NULLT,
`Aranma` INT( 11 ) NOT NULL ,
`Bankapara` INT( 11 ) NOT NULL ,
) ENGINE = MYISAM DEFAULT CHARSET = latin1 COLLATE = latin1_general_ci AUTO_INCREMENT =1;
I think it should work without the red markered command.
Reply
#3

If i delete it(USE sampnights) it sends "No database selected"
Reply
#4

Ok, select a database in the left frame of your browser under the PhpMyAdmin logo. Then click on "SQL" and paste the command. It should work fine.
Reply
#5

It solved,but now it sends
Код:
#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key
.SQL file:
Код:
CREATE TABLE IF NOT EXISTS `hesaplar`
(
`Id` INT(11) NOT NULL AUTO_INCREMENT ,
`Isim` VARCHAR(50) COLLATE latin1_general_ci NOT NULL,
`Sifre_Hash` INT(11) NOT NULL,
`Kayitli` INT(11) NOT NULL,
`SonGiris` INT(11) NOT NULL,
`Para` INT(11) NOT NULL,
`Oldurme` INT(11) NOT NULL,
`Olum` INT(11) NOT NULL,
`Saat` INT(11) NOT NULL,
`Dakika` INT(11) NOT NULL,
`Saniye` INT(11) NOT NULL,
`AdminLevel` INT(11) NOT NULL,
`OyunSure` INT(11) NOT NULL,
`Skor` INT(11) NOT NULL,
`Orgut` INT(11) NOT NULL,
`Lider` INT(11) NOT NULL,
`Rutbe` INT(11) NOT NULL,
`EskiOldurme` INT(11) NOT NULL,
`EskiOlum` INT(11) NOT NULL,
`Aranma` INT(11) NOT NULL,
`Bankapara` INT(11) NOT NULL
)ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;
Reply
#6

It doesnt work... Im testing it at my mysql server.
Reply
#7

Quote:
Originally Posted by DJBluefader
Посмотреть сообщение
Delete this and try it again.
Don't post if you have no idea of MySQL.


This must work, i tested it:

Код:
CREATE TABLE IF NOT EXISTS `hesaplar` (
`Id` INT(11) NOT NULL AUTO_INCREMENT,
`Isim` VARCHAR(50) NOT NULL,
`Sifre_Hash` INT(11) NOT NULL,
`Kayitli` INT(11) NOT NULL,
`SonGiris` INT(11) NOT NULL,
`Para` INT(11) NOT NULL,
`Oldurme` INT(11) NOT NULL,
`Olum` INT(11) NOT NULL,
`Saat` INT(11) NOT NULL,
`Dakika` INT(11) NOT NULL,
`Saniye` INT(11) NOT NULL,
`AdminLevel` INT(11) NOT NULL,
`OyunSure` INT(11) NOT NULL,
`Skor` INT(11) NOT NULL,
`Orgut` INT(11) NOT NULL,
`Lider` INT(11) NOT NULL,
`Rutbe` INT(11) NOT NULL,
`EskiOldurme` INT(11) NOT NULL,
`EskiOlum` INT(11) NOT NULL,
`Aranma` INT(11) NOT NULL,
`Bankapara` INT(11) NOT NULL,
PRIMARY KEY  (`Id`)
)ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
Reply
#8

The answer from WackoX works fine =D

Ђdit: I have no idea for mysql? Are you serious? Oo Go kidding somewhere else!
Reply
#9

Quote:
Originally Posted by WackoX
Посмотреть сообщение
Don't post if you have no idea of MySQL.


This must work, i tested it:

Код:
CREATE TABLE IF NOT EXISTS `hesaplar` (
`Id` INT(11) NOT NULL AUTO_INCREMENT,
`Isim` VARCHAR(50) NOT NULL,
`Sifre_Hash` INT(11) NOT NULL,
`Kayitli` INT(11) NOT NULL,
`SonGiris` INT(11) NOT NULL,
`Para` INT(11) NOT NULL,
`Oldurme` INT(11) NOT NULL,
`Olum` INT(11) NOT NULL,
`Saat` INT(11) NOT NULL,
`Dakika` INT(11) NOT NULL,
`Saniye` INT(11) NOT NULL,
`AdminLevel` INT(11) NOT NULL,
`OyunSure` INT(11) NOT NULL,
`Skor` INT(11) NOT NULL,
`Orgut` INT(11) NOT NULL,
`Lider` INT(11) NOT NULL,
`Rutbe` INT(11) NOT NULL,
`EskiOldurme` INT(11) NOT NULL,
`EskiOlum` INT(11) NOT NULL,
`Aranma` INT(11) NOT NULL,
`Bankapara` INT(11) NOT NULL,
PRIMARY KEY  (`Id`)
)ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
It worked,thx.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)