5 Errors in my script
#1

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
Reply
#2

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;
}
Reply
#3

Quote:
Originally Posted by iGetty
View Post
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.
Reply
#4

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;

Reply
#5

Quote:
Originally Posted by oMa37
View Post
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
Reply
#6

The code works for me, Try re-installing the samp package again
Reply
#7

Anybody?
Reply
#8

Any Comment?
Reply
#9

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!
Reply
#10

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.
Reply
#11

Quote:
Originally Posted by jlalt
View Post
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.
Reply
#12

Quote:
Originally Posted by Stinged
View Post
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
Reply
#13

Quote:
Originally Posted by jlalt
View Post
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.
Reply
#14

is the tables are not saving or its value?i recommend you to create the tables with in the database browser
Reply
#15

Quote:
Originally Posted by Sreyas
View Post
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.
Reply
#16

Any comment? because i want to fix this.
Reply
#17

ANY HELP?
Reply
#18

"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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)