SA-MP Forums Archive
SQL Issues... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SQL Issues... (/showthread.php?tid=166544)



SQL Issues... - ScottCFR - 09.08.2010

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;
}



Re: SQL Issues... - Daren_Jacobson - 09.08.2010

query[60] needs to be bigger, try [100]


Re: SQL Issues... - coole210 - 09.08.2010

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


Re: SQL Issues... - Carlton - 09.08.2010

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;
}



Re: SQL Issues... - Daren_Jacobson - 09.08.2010

64 would still be too small....

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


Re: SQL Issues... - Kar - 09.08.2010

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 ):


Re: SQL Issues... - Mr187 - 09.08.2010

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


Re: SQL Issues... - Daren_Jacobson - 09.08.2010

Talking about me or coole?


Re: SQL Issues... - Kar - 09.08.2010

....


Re: SQL Issues... - Daren_Jacobson - 09.08.2010

okay then, explain yourself.


Re: SQL Issues... - Kar - 09.08.2010

[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.


Re: SQL Issues... - Daren_Jacobson - 09.08.2010

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.


Re: SQL Issues... - Kar - 09.08.2010

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


Re: SQL Issues... - Daren_Jacobson - 09.08.2010

it wouldn't give that error but whatever.

@ScottCFR Did you ever fix it?