SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/06/2018, 01:52 AM   #1
Nru
Big Clucker
 
Join Date: Jun 2017
Posts: 53
Reputation: 2
Default Why it's not working ?

PHP Code:
string "CREATE TABLE IF NOT EXISTS masters (MASTER_ID int(11) NOT NULL AUTO_INCREMENT,\
    NAME varchar(24) NOT NULL,\
    IP varchar(24) NOT NULL,\
    PASSWORD char(65) NOT NULL,\
    SALT char(11) NOT NULL,\
    BAN tinyint(1) NOT NULL DEFAULT '0',\
    DATE int(11) NOT NULL DEFAULT '0',\
    EXPIRATION int(11) NOT NULL DEFAULT '0',\
    CHAR_ID[0] int(11) NOT NULL DEFAULT '0',\
    CHAR_ID[1] int(11) NOT NULL DEFAULT '0',\
    CHAR_ID[2] int(11) NOT NULL DEFAULT '0', PRIMARY KEY (ID), UNIQUE KEY NAME (NAME))"
;
    
mysql_tquery(Databasestring); 
I get this error
Code:
[18:42:21] [plugins/mysql] error #1064 while executing query "CREATE TABLE IF NOT EXISTS masters (ID int(11) NOT NULL AUTO_INCREMENT,NAME varchar(24) NOT NULL,IP varchar(24) NOT NULL,PASSWORD char(65) NOT NULL,SALT char(11) NOT NULL,BAN tinyint(1) NOT NULL DEFAULT '0',DATE int(11) NOT NULL DEFAULT '0',EXPIRATION int(11) NOT NULL DEFAULT '0',CHAR_ID[0] int(11) NOT NULL DEFAULT '0',CHAR_ID[1] int(11) NOT NULL DEFAULT '0',CHAR_ID[2] int(11) NOT NULL DEFAULT '0', PRIMARY KEY (ID), UNIQUE KEY NAME (NAME))": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '[0] int(11) NOT NULL DEFAULT '0',CHAR_ID[1] int(11) NOT NULL DEFAULT '0',' at line 1
Why is the [] are not working
__________________
It's just fine to give a reputation to whoever helped you, hoe.
Nru is offline   Reply With Quote
Old 14/06/2018, 05:21 AM   #2
Nru
Big Clucker
 
Join Date: Jun 2017
Posts: 53
Reputation: 2
Default Re: Why it's not working ?

Any help ??
__________________
It's just fine to give a reputation to whoever helped you, hoe.
Nru is offline   Reply With Quote
Old 14/06/2018, 05:42 AM   #3
GTLS
Gangsta
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 724
Reputation: 88
Default Re: Why it's not working ?

Not 100% sure but I believe, MySQL Column names with brackets has different function so Its not gonna let you use them. You can use like, CHAR_ID_0, CHAR_ID_1 etc...
__________________

I don't help for rep. I help cuz I was helped in the past.


California State Roleplay - X Update Now under beta testing phase. Stay Tuned.
GTLS is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timers stop working after working for the most part of the day. [WSF]ThA_Devil Scripting Help 0 17/06/2015 09:10 PM
Hosting Issues - Y_ini saving/loading isn't working and OnDialogResponse isn't working. Aerotactics Server Support 3 30/03/2014 08:44 AM
Working Vehicle storage system (100% working) eclipses Scripting Help 6 14/10/2012 09:13 PM
[Working]Offroad Map isnt finished[working] stefano191 Screenshots and Videos 6 07/03/2010 09:43 PM


All times are GMT. The time now is 08:06 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.