02.11.2009, 14:43
Quote:
Originally Posted by MenaceX^
Awesome, thanks a lot.
|
Originally Posted by MenaceX^
Awesome, thanks a lot.
|
Originally Posted by Dedepc
I've tested my function with your old version but, i get the same problem as before
Related : http://forum.sa-mp.com/index.php?top...7099#msg787099 I cannot use my function twice Server crash at Код:
samp_mysql_fetch_row(ligne_brute); samp_mysql_get_field(info, ligne_resultat); |
Originally Posted by SoeH
Quote:
I'm using this function and my server crash. What can i do? |
Originally Posted by SE7ENGX
I've been playing with this for the last couple days but it seems the plugin crashes my server. Windows Server 2003, and also tried on XP SP3. I have mysql knowledge but apparently there wasn't anything that went wrong. SAMP Server simply just closed after a successful connection and query attempt. MySQL 5.1, apache... any ideas?
|
Originally Posted by Joe Staff
Quote:
|
while (idx < sizeof(HouseInfo)) { new query[128],result[256],loop[256]; new poop = 1; format(query,sizeof(query),"SELECT * FROM Houses WHERE ID = '%d'",idx); samp_mysql_query(query); samp_mysql_store_result(); samp_mysql_fetch_row(result); if(samp_mysql_num_rows() == 1) { samp_mysql_strtok(loop, "|", result); while(samp_mysql_strtok(loop, "|", "")) { //Do stuff poop++; } idx++; } }
Originally Posted by Redgie
Quick Question, here is some code I use, cut down and simplified
Код:
while (idx < sizeof(HouseInfo)) { new query[128],result[256],loop[256]; new poop = 1; format(query,sizeof(query),"SELECT * FROM Houses WHERE ID = '%d'",idx); samp_mysql_query(query); samp_mysql_store_result(); samp_mysql_fetch_row(result); if(samp_mysql_num_rows() == 1) { samp_mysql_strtok(loop, "|", result); while(samp_mysql_strtok(loop, "|", "")) { //Do stuff poop++; } idx++; } } |
while(samp_mysql_fetch_row(resultline))
{
// the strtok stuff.
}
Originally Posted by MenaceX^
I suppose you forgot samp_mysql_fetch_row, and I'd rather do this that way:
pawn Код:
|
samp_mysql_query(query);
samp_mysql_store_result();
samp_mysql_fetch_row(result);
format(query, sizeof(query), "SELECT * FROM `users` WHERE `name` = '%s'", pname2); print("after SELECT"); samp_mysql_query(query); print("after query"); samp_mysql_store_result(); print("after store_result"); samp_mysql_fetch_row(line); print("after fetch row");
Originally Posted by Tirus
Hi,
iґve got a problem with my mysql login: I can only login one time if i disconnect and try to login again, the server crashes. this is my code : http://pastebin.com/92ax3YYD now i made this: Код:
format(query, sizeof(query), "SELECT * FROM `users` WHERE `name` = '%s'", pname2); print("after SELECT"); samp_mysql_query(query); print("after query"); samp_mysql_store_result(); print("after store_result"); samp_mysql_fetch_row(line); print("after fetch row"); |
samp_mysql_fetch_row(line); |
[16:00:19] Loading plugin: libmysqlclient.so [16:00:19] Failed (/lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by plugins/libmysqlclient.so)) [16:00:19] Loaded 0 plugins.
new gangmember[15][128];
new Data[1024];
new Field[64];
new rcnt = 1;
MySQLFetchGangRecord(PlayerInfo[playerid][pGID], Data);
samp_mysql_strtok(Field, "|", Data);
while (samp_mysql_strtok(Field, "|", "")==1)
{
if (rcnt == 7) gangmember[0] = strmid(gangmember[0], Field, 0, strlen(Field)-1, 255);
if (rcnt == 8) gangmember[1] = strmid(gangmember[1], Field, 0, strlen(Field)-1, 255);
if (rcnt == 9) gangmember[2] = strmid(gangmember[2], Field, 0, strlen(Field)-1, 255);
if (rcnt == 10) gangmember[3] = strmid(gangmember[3], Field, 0, strlen(Field)-1, 255);
if (rcnt == 11) gangmember[4] = strmid(gangmember[4], Field, 0, strlen(Field)-1, 255);
if (rcnt == 12) gangmember[5] = strmid(gangmember[5], Field, 0, strlen(Field)-1, 255);
if (rcnt == 13) gangmember[6] = strmid(gangmember[6], Field, 0, strlen(Field)-1, 255);
if (rcnt == 14) gangmember[7] = strmid(gangmember[7], Field, 0, strlen(Field)-1, 255);
if (rcnt == 15) gangmember[8] = strmid(gangmember[8], Field, 0, strlen(Field)-1, 255);
if (rcnt == 16) gangmember[9] = strmid(gangmember[9], Field, 0, strlen(Field)-1, 255);
if (rcnt == 17) gangmember[10] = strmid(gangmember[10], Field, 0, strlen(Field)-1, 255);
if (rcnt == 18) gangmember[11] = strmid(gangmember[11], Field, 0, strlen(Field)-1, 255);
if (rcnt == 19) gangmember[12] = strmid(gangmember[12], Field, 0, strlen(Field)-1, 255);
if (rcnt == 20) gangmember[13] = strmid(gangmember[13], Field, 0, strlen(Field)-1, 255);
if (rcnt == 21) gangmember[14] = strmid(gangmember[14], Field, 0, strlen(Field)-1, 255);
rcnt++;
}
D:\xxx\gamemodes\xxx.pwn(18590) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18591) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18592) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18593) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18594) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18595) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18596) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18597) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18598) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18599) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18600) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18601) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18602) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18603) : error 033: array must be indexed (variable "gangmember") D:\xxx\gamemodes\xxx.pwn(18604) : error 033: array must be indexed (variable "gangmember") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 15 Errors.