Raised This Month: $ Target: $400
 0% 

SQL file can't create in my database!!


Post New Thread Reply   
 
Thread Tools Display Modes
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 09-06-2014 , 10:44   Re: SQL file can't create in my database!!
Reply With Quote #11

Code:
INT (10)

and

default '-1'
For real? OMFG

Code:
CREATE TABLE IF NOT EXISTS amx_match_main
(
	match_id SMALLINT NOT NULL AUTO_INCREMENT,
	map1_id SMALLINT NOT NULL default 0,
	map2_id SMALLINT NOT NULL default 0, 
	half1_id SMALLINT NOT NULL default 0,
	half2_id SMALLINT NOT NULL default 0,
	half3_id SMALLINT NOT NULL default 0,
	half4_id SMALLINT NOT NULL default 0,
	half5_id SMALLINT NOT NULL default 0,
	half6_id SMALLINT NOT NULL default 0,
	half7_id SMALLINT NOT NULL default 0,
	half8_id SMALLINT NOT NULL default 0,
	PRIMARY KEY(match_id)
)
You can not deal with an INTEGER TYPE using single or double quotes, and you never (I think) need to be insert a size of an integer field in mysql.
Oh and you never do not need to use quotes in a table or field name in SQL, because they can't be created using spaces.

EDIT: I have attached the .sql file (Working for me)
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 09-06-2014 at 11:14.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Icery
Junior Member
Join Date: Feb 2012
Old 09-06-2014 , 14:57   Re: SQL file can't create in my database!!
Reply With Quote #12

now i can use my orignal account again :-/

i already use your way to change my sql like this

Quote:
# MySQL file for AMXMDs Stats
# --------------------------------------------------------

#
# Table structure for table amx_match_main
#
# half1 = half1; half2 = half2; half3 = ot1; half4 = ot2
# map2: half5 = half1; half6 = half2; half7 = ot1; half8 = ot2
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_main (
match_id SMALLINT NOT NULL AUTO_INCREMENT,
map1_id SMALLINT NOT NULL default 0,
map2_id SMALLINT NOT NULL default 0,
half1_id SMALLINT NOT NULL default 0,
half2_id SMALLINT NOT NULL default 0,
half3_id SMALLINT NOT NULL default 0,
half4_id SMALLINT NOT NULL default 0,
half5_id SMALLINT NOT NULL default 0,
half6_id SMALLINT NOT NULL default 0,
half7_id SMALLINT NOT NULL default 0,
half8_id SMALLINT NOT NULL default 0,
PRIMARY KEY(match_id)
)

# --------------------------------------------------------


#
# Table structure for table amx_match_half
#
# team1 -> T
# team2 -> CT
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_half (
half_id int(10) NOT NULL auto_increment,
team1_id int(10) NOT NULL default -1,
team1_score int(4) NOT NULL default 0,
team2_id int(10) NOT NULL default -1,
team2_score int(4) NOT NULL default 0,
PRIMARY KEY (half_id)
)

# --------------------------------------------------------


#
# Table structure for table amx_match_map
#
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_map (
map_id int(10) NOT NULL auto_increment,
map_name varchar(64) NOT NULL default ,
PRIMARY KEY (map_id)
)

# --------------------------------------------------------


#
# Table structure for table amx_match_player
#
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_player (
player_id int(10) NOT NULL auto_increment,
player_steamid varchar(64) NOT NULL default ,
PRIMARY KEY (player_id)
)

# --------------------------------------------------------


#
# Table structure for table amx_match_player_name
#
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_player_name (
name_id int(10) NOT NULL auto_increment,
player_id int(10) NOT NULL default -1,
player_name varchar(64) NOT NULL default ,
PRIMARY KEY (name_id)
)

# --------------------------------------------------------


#
# Table structure for table amx_match_player_statistics
#
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_player_statistics (
statistics_id int(10) NOT NULL auto_increment,
player_id int(10) NOT NULL default -1,
half_id int(10) NOT NULL default -1,
player_frags int(4) NOT NULL default 0,
player_deaths int(4) NOT NULL default 0,
team_id int(10) NOT NULL default -1,
PRIMARY KEY (statistics_id)
)

# --------------------------------------------------------


#
# Table structure for table amx_match_team
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_team (
team_id int(10) NOT NULL auto_increment,
team_name varchar(64) NOT NULL default ,
PRIMARY KEY (team_id)
)

# --------------------------------------------------------

but it show the same error



Last edited by Icery; 09-06-2014 at 16:01. Reason: edit error detail
Icery is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 09-06-2014 , 19:41   Re: SQL file can't create in my database!!
Reply With Quote #13

You have read my post? I think not!

Remove sizes from int
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-06-2014 , 20:07   Re: SQL file can't create in my database!!
Reply With Quote #14

Quote:
Originally Posted by ^SmileY View Post
Remove sizes from int
Not required. 5.5 supports both ways.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Icery
Junior Member
Join Date: Feb 2012
Old 09-07-2014 , 00:16   Re: SQL file can't create in my database!!
Reply With Quote #15

Quote:
Originally Posted by ^SmileY View Post
You have read my post? I think not!

Remove sizes from int
Like this.........?

Quote:
# MySQL file for AMXMDs Stats
# --------------------------------------------------------

#
# Table structure for table amx_match_main
#
# half1 = half1; half2 = half2; half3 = ot1; half4 = ot2
# map2: half5 = half1; half6 = half2; half7 = ot1; half8 = ot2
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_main (
match_id SMALLINT NOT NULL AUTO_INCREMENT,
map1_id SMALLINT NOT NULL default 0,
map2_id SMALLINT NOT NULL default 0,
half1_id SMALLINT NOT NULL default 0,
half2_id SMALLINT NOT NULL default 0,
half3_id SMALLINT NOT NULL default 0,
half4_id SMALLINT NOT NULL default 0,
half5_id SMALLINT NOT NULL default 0,
half6_id SMALLINT NOT NULL default 0,
half7_id SMALLINT NOT NULL default 0,
half8_id SMALLINT NOT NULL default 0,
PRIMARY KEY(match_id)
)

# --------------------------------------------------------


#
# Table structure for table amx_match_half
#
# team1 -> T
# team2 -> CT
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_half (
half_id SMALLINT NOT NULL auto_increment,
team1_id SMALLINT NOT NULL default 0,
team1_score SMALLINT NOT NULL default 0,
team2_id SMALLINT NOT NULL default 0,
team2_score SMALLINT NOT NULL default 0,
PRIMARY KEY (half_id)
)

# --------------------------------------------------------


#
# Table structure for table amx_match_map
#
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_map (
map_id SMALLINT NOT NULL auto_increment,
map_name varchar(64) NOT NULL default ,
PRIMARY KEY (map_id)
)

# --------------------------------------------------------


#
# Table structure for table amx_match_player
#
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_player (
player_id SMALLINT NOT NULL auto_increment,
player_steamid varchar(64) NOT NULL default ,
PRIMARY KEY (player_id)
)

# --------------------------------------------------------


#
# Table structure for table amx_match_player_name
#
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_player_name (
name_id SMALLINT NOT NULL auto_increment,
player_id SMALLINT NOT NULL default 0,
player_name varchar(64) NOT NULL default ,
PRIMARY KEY (name_id)
)

# --------------------------------------------------------


#
# Table structure for table amx_match_player_statistics
#
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_player_statistics (
statistics_id SMALLINT NOT NULL auto_increment,
player_id SMALLINT NOT NULL default 0,
half_id SMALLINT NOT NULL default 0,
player_frags SMALLINT NOT NULL default 0,
player_deaths SMALLINT NOT NULL default 0,
team_id SMALLINT NOT NULL default 0,
PRIMARY KEY (statistics_id)
)

# --------------------------------------------------------


#
# Table structure for table amx_match_team
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_team (
team_id SMALLINT NOT NULL auto_increment,
team_name varchar(64) NOT NULL default ,
PRIMARY KEY (team_id)
)

# --------------------------------------------------------


It fail eiher.........

Icery is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-07-2014 , 00:18   Re: SQL file can't create in my database!!
Reply With Quote #16

Stick a semi-colon after each query
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Icery
Junior Member
Join Date: Feb 2012
Old 09-07-2014 , 01:02   Re: SQL file can't create in my database!!
Reply With Quote #17

Quote:
Originally Posted by YamiKaitou View Post
Stick a semi-colon after each query
Sorry......I don't understand what you mean.........
I'm not good at sql and English..........
Can you help me to fix it andshow me.......? plz..
Icery is offline
Icery
Junior Member
Join Date: Feb 2012
Old 09-07-2014 , 01:05   Re: SQL file can't create in my database!!
Reply With Quote #18

do you have teamviwer :-/?
you can control my PC!
Icery is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-07-2014 , 01:09   Re: SQL file can't create in my database!!
Reply With Quote #19

Put a ; at the end of each statement. Or execute each statement by itself
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Icery
Junior Member
Join Date: Feb 2012
Old 09-07-2014 , 01:30   Re: SQL file can't create in my database!!
Reply With Quote #20

Quote:
Originally Posted by YamiKaitou View Post
Put a ; at the end of each statement. Or execute each statement by itself
I try to fix like this

Quote:
# MySQL file for AMXMDs Stats
# --------------------------------------------------------

#
# Table structure for table amx_match_main
#
# half1 = half1; half2 = half2; half3 = ot1; half4 = ot2
# map2: half5 = half1; half6 = half2; half7 = ot1; half8 = ot2
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_main (
match_id SMALLINT NOT NULL AUTO_INCREMENT,
map1_id SMALLINT NOT NULL default 0,
map2_id SMALLINT NOT NULL default 0,
half1_id SMALLINT NOT NULL default 0,
half2_id SMALLINT NOT NULL default 0,
half3_id SMALLINT NOT NULL default 0,
half4_id SMALLINT NOT NULL default 0,
half5_id SMALLINT NOT NULL default 0,
half6_id SMALLINT NOT NULL default 0,
half7_id SMALLINT NOT NULL default 0,
half8_id SMALLINT NOT NULL default 0,
PRIMARY KEY(match_id)
);

# --------------------------------------------------------


#
# Table structure for table amx_match_half
#
# team1 -> T
# team2 -> CT
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_half (
half_id SMALLINT NOT NULL auto_increment,
team1_id SMALLINT NOT NULL default 0,
team1_score SMALLINT NOT NULL default 0,
team2_id SMALLINT NOT NULL default 0,
team2_score SMALLINT NOT NULL default 0,
PRIMARY KEY (half_id)
);

# --------------------------------------------------------


#
# Table structure for table amx_match_map
#
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_map (
map_id SMALLINT NOT NULL auto_increment,
map_name varchar(64) NOT NULL default ,
PRIMARY KEY (map_id)
);

# --------------------------------------------------------


#
# Table structure for table amx_match_player
#
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_player (
player_id SMALLINT NOT NULL auto_increment,
player_steamid varchar(64) NOT NULL default ,
PRIMARY KEY (player_id)
);

# --------------------------------------------------------


#
# Table structure for table amx_match_player_name
#
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_player_name (
name_id SMALLINT NOT NULL auto_increment,
player_id SMALLINT NOT NULL default 0,
player_name varchar(64) NOT NULL default ,
PRIMARY KEY (name_id)
);

# --------------------------------------------------------


#
# Table structure for table amx_match_player_statistics
#
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_player_statistics (
statistics_id SMALLINT NOT NULL auto_increment,
player_id SMALLINT NOT NULL default 0,
half_id SMALLINT NOT NULL default 0,
player_frags SMALLINT NOT NULL default 0,
player_deaths SMALLINT NOT NULL default 0,
team_id SMALLINT NOT NULL default 0,
PRIMARY KEY (statistics_id)
);

# --------------------------------------------------------


#
# Table structure for table amx_match_team
# --------------------------------------------------------
#

CREATE TABLE IF NOT EXISTS amx_match_team (
team_id SMALLINT NOT NULL auto_increment,
team_name varchar(64) NOT NULL default ,
PRIMARY KEY (team_id)
);

# --------------------------------------------------------
and the error is different now:-/

Icery is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode