[FIXED] 5 Errors in my script -
Twiix - 13.06.2016
Hello SA-MP Forum members, I got 5 errors in my script, That's because this.
Code:
stock loadb()
{
Database = db_open(_DB_);
db_query(Database,"CREATE TABLE IF NOT EXISTS `users`\
(`userid` INTEGER PRIMARY KEY AUTOINCREMENT, `username` TEXT, `IP` TEXT, `joindate` TEXT, `password` TEXT, `admin` NUMERIC, `kills` NUMERIC, `deaths` NUMERIC, `score` NUMERIC, `fbscore` NUMERIC, `ddscore` NUMERIC, `frscore` NUMERIC, `rscore` NUMERIC, `dmscore` NUMERIC, `money` NUMERIC, `warn` NUMERIC, `mute` NUMERIC, `mutesec` NUMERIC, `cmute` NUMERIC, `cmutesec` NUMERIC, `jail` NUMERIC, `jailsec` NUMERIC, `hours` NUMERIC, `minutes` NUMERIC, `seconds` NUMERIC, `question` TEXT, `answer` TEXT, `vip` NUMERIC)");
db_query(Database,
"CREATE TABLE IF NOT EXISTS `bans` (`username` TEXT, `ip` TEXT, `banby` TEXT, `banreason` TEXT, `banwhen` TEXT)");
return 1;
}
The Errors:
Code:
fatal error 107: too many error messages on one line
error 017: undefined symbol "TABLE"
error 017: undefined symbol "CREATE"
error 037: invalid string (possibly non-terminated string)
error 075: input line too long (after substitutions)
EDIT: Fixed
Re: 5 Errors in my script -
iGetty - 13.06.2016
Try this:
pawn Code:
stock loadb()
{
Database = db_open(_DB_);
db_query(Database,
"CREATE TABLE IF NOT EXISTS `users`\
(`userid` INTEGER PRIMARY KEY AUTOINCREMENT, `username` TEXT, `IP` TEXT, `joindate` TEXT, `password` TEXT, `admin` NUMERIC, `kills` NUMERIC, `deaths` NUMERIC, `score` NUMERIC, `fbscore` NUMERIC, `ddscore` NUMERIC, `frscore` NUMERIC, `rscore` NUMERIC, `dmscore` NUMERIC, `money` NUMERIC, `warn` NUMERIC, `mute` NUMERIC,\
`mutesec` NUMERIC, `cmute` NUMERIC, `cmutesec` NUMERIC, `jail` NUMERIC, `jailsec` NUMERIC, `hours` NUMERIC, `minutes` NUMERIC, `seconds` NUMERIC, `question` TEXT, `answer` TEXT, `vip` NUMERIC)");
db_query(Database,
"CREATE TABLE IF NOT EXISTS `bans` (`username` TEXT, `ip` TEXT, `banby` TEXT, `banreason` TEXT, `banwhen` TEXT)");
return 1;
}
Re: 5 Errors in my script -
Twiix - 13.06.2016
Quote:
Originally Posted by iGetty
Try this:
pawn Code:
stock loadb() { Database = db_open(_DB_); db_query(Database, "CREATE TABLE IF NOT EXISTS `users`\ (`userid` INTEGER PRIMARY KEY AUTOINCREMENT, `username` TEXT, `IP` TEXT, `joindate` TEXT, `password` TEXT, `admin` NUMERIC, `kills` NUMERIC, `deaths` NUMERIC, `score` NUMERIC, `fbscore` NUMERIC, `ddscore` NUMERIC, `frscore` NUMERIC, `rscore` NUMERIC, `dmscore` NUMERIC, `money` NUMERIC, `warn` NUMERIC, `mute` NUMERIC,\ `mutesec` NUMERIC, `cmute` NUMERIC, `cmutesec` NUMERIC, `jail` NUMERIC, `jailsec` NUMERIC, `hours` NUMERIC, `minutes` NUMERIC, `seconds` NUMERIC, `question` TEXT, `answer` TEXT, `vip` NUMERIC)");
db_query(Database, "CREATE TABLE IF NOT EXISTS `bans` (`username` TEXT, `ip` TEXT, `banby` TEXT, `banreason` TEXT, `banwhen` TEXT)");
return 1; }
|
Not working, still this errors and nothing.
Re: 5 Errors in my script -
oMa37 - 13.06.2016
PHP Code:
stock loadb()
{
Database = db_open(_DB_);
db_query(Database,"CREATE TABLE IF NOT EXISTS `users`\
(`userid` INTEGER PRIMARY KEY AUTOINCREMENT, `username` TEXT, `IP` TEXT, `joindate` TEXT, `password` TEXT, `admin` NUMERIC, `kills` NUMERIC, `deaths` NUMERIC, `score` NUMERIC, `fbscore` NUMERIC, `ddscore` NUMERIC, `frscore` NUMERIC, `rscore` NUMERIC, `dmscore` NUMERIC, `money` NUMERIC, `warn` NUMERIC, `mute` NUMERIC,\
`mutesec` NUMERIC, `cmute` NUMERIC, `cmutesec` NUMERIC, `jail` NUMERIC, `jailsec` NUMERIC, `hours` NUMERIC, `minutes` NUMERIC, `seconds` NUMERIC, `question` TEXT, `answer` TEXT, `vip` NUMERIC)");
db_query(Database,"CREATE TABLE IF NOT EXISTS `bans` (`username` TEXT, `ip` TEXT, `banby` TEXT, `banreason` TEXT, `banwhen` TEXT)");
return 1;
}
Re: 5 Errors in my script -
Twiix - 13.06.2016
Quote:
Originally Posted by oMa37
PHP Code:
stock loadb()
{
Database = db_open(_DB_);
db_query(Database,"CREATE TABLE IF NOT EXISTS `users`\
(`userid` INTEGER PRIMARY KEY AUTOINCREMENT, `username` TEXT, `IP` TEXT, `joindate` TEXT, `password` TEXT, `admin` NUMERIC, `kills` NUMERIC, `deaths` NUMERIC, `score` NUMERIC, `fbscore` NUMERIC, `ddscore` NUMERIC, `frscore` NUMERIC, `rscore` NUMERIC, `dmscore` NUMERIC, `money` NUMERIC, `warn` NUMERIC, `mute` NUMERIC,\
`mutesec` NUMERIC, `cmute` NUMERIC, `cmutesec` NUMERIC, `jail` NUMERIC, `jailsec` NUMERIC, `hours` NUMERIC, `minutes` NUMERIC, `seconds` NUMERIC, `question` TEXT, `answer` TEXT, `vip` NUMERIC)");
db_query(Database,"CREATE TABLE IF NOT EXISTS `bans` (`username` TEXT, `ip` TEXT, `banby` TEXT, `banreason` TEXT, `banwhen` TEXT)");
return 1;
}
|
Still not working, 5 Errors
Re: 5 Errors in my script -
oMa37 - 13.06.2016
The code works for me, Try re-installing the samp package again
Re: 5 Errors in my script -
Twiix - 13.06.2016
Anybody?
Re: 5 Errors in my script -
Twiix - 14.06.2016
Any Comment?
Re: 5 Errors in my script -
jlalt - 14.06.2016
here we go:
PHP Code:
loadb()
{
Database = db_open(_DB_);
new Query[1500];
strins(Query,"CREATE TABLE IF NOT EXISTS `users`(`userid` INTEGER PRIMARY KEY AUTOINCREMENT, `username` TEXT, `IP` TEXT, `joindate` TEXT, `password` TEXT, `admin` NUMERIC,", strlen(Query));
strins(Query," `kills` NUMERIC, `deaths` NUMERIC, `score` NUMERIC, `fbscore` NUMERIC, `ddscore` NUMERIC, `frscore` NUMERIC, `rscore` NUMERIC, `dmscore` NUMERIC, `money` NUMERIC,", strlen(Query));
strins(Query," `warn` NUMERIC, `mute` NUMERIC, `mutesec` NUMERIC, `cmute` NUMERIC, `cmutesec` NUMERIC, `jail` NUMERIC, `jailsec` NUMERIC, `hours` NUMERIC, `minutes` NUMERIC, `seconds` NUMERIC, `question` TEXT, `answer` TEXT, `vip` NUMERIC)", strlen(Query));
db_query(Database,Query);
db_query(Database,
"CREATE TABLE IF NOT EXISTS `bans` (`username` TEXT, `ip` TEXT, `banby` TEXT, `banreason` TEXT, `banwhen` TEXT)");
return 1;
}
What is strins!
What is strlen!
Stop the abuse of stock!
Re: 5 Errors in my script -
Stinged - 14.06.2016
jlalt, that should work, but it's much better to use
strcat insead of strins.
You're only adding the string to the array, so there's no need to use strins.
strcat automatically adds it to the end.
Re: 5 Errors in my script -
Twiix - 14.06.2016
Quote:
Originally Posted by jlalt
here we go:
PHP Code:
loadb()
{
Database = db_open(_DB_);
new Query[1500];
strins(Query,"CREATE TABLE IF NOT EXISTS `users`(`userid` INTEGER PRIMARY KEY AUTOINCREMENT, `username` TEXT, `IP` TEXT, `joindate` TEXT, `password` TEXT, `admin` NUMERIC,", strlen(Query));
strins(Query," `kills` NUMERIC, `deaths` NUMERIC, `score` NUMERIC, `fbscore` NUMERIC, `ddscore` NUMERIC, `frscore` NUMERIC, `rscore` NUMERIC, `dmscore` NUMERIC, `money` NUMERIC,", strlen(Query));
strins(Query," `warn` NUMERIC, `mute` NUMERIC, `mutesec` NUMERIC, `cmute` NUMERIC, `cmutesec` NUMERIC, `jail` NUMERIC, `jailsec` NUMERIC, `hours` NUMERIC, `minutes` NUMERIC, `seconds` NUMERIC, `question` TEXT, `answer` TEXT, `vip` NUMERIC)", strlen(Query));
db_query(Database,Query);
db_query(Database,
"CREATE TABLE IF NOT EXISTS `bans` (`username` TEXT, `ip` TEXT, `banby` TEXT, `banreason` TEXT, `banwhen` TEXT)");
return 1;
}
What is strins!
What is strlen!
Stop the abuse of stock!
|
Thank You!, It's working.
Re: 5 Errors in my script -
jlalt - 14.06.2016
Quote:
Originally Posted by Stinged
jlalt, that should work, but it's much better to use strcat insead of strins.
You're only adding the string to the array, so there's no need to use strins.
strcat automatically adds it to the end.
|
I know lol, just wanted to make it different from usual : d
Re: 5 Errors in my script -
Twiix - 14.06.2016
Quote:
Originally Posted by jlalt
here we go:
PHP Code:
loadb()
{
Database = db_open(_DB_);
new Query[1500];
strins(Query,"CREATE TABLE IF NOT EXISTS `users`(`userid` INTEGER PRIMARY KEY AUTOINCREMENT, `username` TEXT, `IP` TEXT, `joindate` TEXT, `password` TEXT, `admin` NUMERIC,", strlen(Query));
strins(Query," `kills` NUMERIC, `deaths` NUMERIC, `score` NUMERIC, `fbscore` NUMERIC, `ddscore` NUMERIC, `frscore` NUMERIC, `rscore` NUMERIC, `dmscore` NUMERIC, `money` NUMERIC,", strlen(Query));
strins(Query," `warn` NUMERIC, `mute` NUMERIC, `mutesec` NUMERIC, `cmute` NUMERIC, `cmutesec` NUMERIC, `jail` NUMERIC, `jailsec` NUMERIC, `hours` NUMERIC, `minutes` NUMERIC, `seconds` NUMERIC, `question` TEXT, `answer` TEXT, `vip` NUMERIC)", strlen(Query));
db_query(Database,Query);
db_query(Database,
"CREATE TABLE IF NOT EXISTS `bans` (`username` TEXT, `ip` TEXT, `banby` TEXT, `banreason` TEXT, `banwhen` TEXT)");
return 1;
}
What is strins!
What is strlen!
Stop the abuse of stock!
|
Oops, it's compiling well, but it's not saving to my database, Help me.
Re: 5 Errors in my script -
SyS - 14.06.2016
is the tables are not saving or its value?i recommend you to create the tables with in the database browser
Re: 5 Errors in my script -
Twiix - 14.06.2016
Quote:
Originally Posted by Sreyas
is the tables are not saving or its value?i recommend you to create the tables with in the database browser
|
The Table that in database browser is not saving, I'm registering normal then i go open the Database browser to see it's registered or not i can't find the table.
Re: 5 Errors in my script -
Twiix - 14.06.2016
Any comment? because i want to fix this.
Re: 5 Errors in my script -
Twiix - 15.06.2016
ANY HELP?
Re: 5 Errors in my script -
Sew_Sumi - 15.06.2016
"It's working" Edits OP to remove original fault like a selfish forum user (You shouldn't remove the OP, or any of your posts due to others, looking for a solution to the same problem will now find nothing, defeating the purpose of the SA-MP forums) then finds it's not actually working, and that copy-pasting isn't doing so good for them...
Obviously that fix taught you a lot.