SQL Issues...
#1

A few days ago.... I made a SQL thing that posted the bans in a database. I don't know if I altered the code, or it's my host. But it doesn't query anymore.


Code:
stock CreateBan(playerid)
{
    new query[64],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new Year, Month, Day;
    getdate(Year, Month, Day);
    format(query, sizeof(query),"INSERT INTO `bans` (`name`, `dob`) VALUES ('%s', '%02d-%02d-%02d');",name,Year,Month,Day);
    mysql_query(query);
    return 1;
}
Reply
#2

query[60] needs to be bigger, try [100]
Reply
#3

I would get rid of all query strings and add a new query[1000]; to the top for all SQL queries big or small..
Reply
#4

pawn Code:
stock CreateBan(playerid)
{
    new query[64],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new Year, Month, Day;
    getdate(Year, Month, Day);
    format(query, sizeof(query),"INSERT INTO `bans` (`name`, `dob`) VALUES ('%s', %02d-%02d-%02d)",name,Year,Month,Day);
    mysql_query(query);
    return 1;
}
Reply
#5

64 would still be too small....

AND WHY THE HECK WOULD YOU MAKE A STRING 1000 BIG? EVER?
Reply
#6

Quote:
Originally Posted by Daren_Jacobson
View Post
64 would still be too small....

AND WHY THE HECK WOULD YOU MAKE A STRING 1000 BIG? EVER?
Sorry for my post ):
Reply
#7

Quote:
Originally Posted by Kar
View Post
biggest idiot ever
Agreee...
Reply
#8

Talking about me or coole?
Reply
#9

....
Reply
#10

okay then, explain yourself.
Reply
#11

[1000] will save u from doing new string [128] all the time>? and less usage of stack or byte thing w/e it is that makes the compiler show the coding header thing.

if you dont know what it is take one of your stocks and put it over ongamemodeinit and u'll see what i mean.
Reply
#12

okay first he said put 1000 over every query, so this is not a global, but still:
1000 exists for all runtime,
or
100 exists for a few milliseconds.
Reply
#13

well his query's are big.. it all depends on you tbh. put what you want. if it says size doesn't not match definition just try to put something higher. i can't really explain good enough you wont understand
Reply
#14

it wouldn't give that error but whatever.

@ScottCFR Did you ever fix it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)