03.01.2010, 13:59
Its my 1st time using the plugin of the mysql of G-sTyLeZzZ( <a_mysql>), because i need to use this plugin for the server. But when i get the information from the SQL, the server crashes..., im using this plugin because its compatible with the server of im the scripter.
Original code of my FS: (using the other mysql plugin)
This is the code:
EDIT: Solved but i don't get the information to the player, the textdraw don't get the string. I think they don't load the information of the sql to the player
Original code of my FS: (using the other mysql plugin)
Quote:
new id = 0; id = ComprobarWeb; printf("ID : %d", id); new arrCoords[8][256]; new sql[80]; new row[512]; format(sql, sizeof(sql), "SELECT COUNT(*) FROM Webs"); samp_mysql_query(sql); samp_mysql_store_result(); samp_mysql_fetch_row(row); samp_mysql_free_result(); format(sql, sizeof(sql), "SELECT * FROM webs WHERE LOWER(Direccion) = ('%s')", text); samp_mysql_query(sql); samp_mysql_store_result(); if (samp_mysql_num_rows() > 0) { samp_mysql_fetch_row(row); split(row, arrCoords, '|'); samp_mysql_free_result(); strmid(MYSQLWeb[id][Direccion], arrCoords[1], 0, strlen(arrCoords[1]), 255); strmid(MYSQLWeb[id][Texto1], arrCoords[2], 0, strlen(arrCoords[2]), 255); strmid(MYSQLWeb[id][Texto2], arrCoords[3], 0, strlen(arrCoords[3]), 255); strmid(MYSQLWeb[id][Texto3], arrCoords[4], 0, strlen(arrCoords[4]), 255); strmid(MYSQLWeb[id][Texto4], arrCoords[5], 0, strlen(arrCoords[5]), 255); strmid(MYSQLWeb[id][Texto5], arrCoords[6], 0, strlen(arrCoords[6]), 255); strmid(MYSQLWeb[id][Texto6], arrCoords[7], 0, strlen(arrCoords[7]), 255); //printf("%s %s %s %s ", MYSQLWeb[id][Texto1],MYSQLWeb[id][Texto2],MYSQLWeb[id][Texto3],MYSQLWeb[id][Texto4]); format(string, sizeof(string), " %s~n~ %s~n~ %s~n~", MYSQLWeb[id][Texto1],MYSQLWeb[id][Texto2],MYSQLWeb[id][Texto3]); TextDrawSetString(PantallaPCNavegadorX[playerid],string); format(stringX, sizeof(stringX), " %s~n~ %s~n~ %s~n~ ", MYSQLWeb[id][Texto4], MYSQLWeb[id][Texto5],MYSQLWeb[id][Texto6]); TextDrawSetString(PantallaPCNavegadorX2[playerid],stringX); JugadorNavegandoEscribeWeb[playerid] = 0; } |
Quote:
new id = 0; id = ComprobarWeb; printf("ID : %d", id); new arrCoords[8][256]; new sql[80]; new row[512]; format(sql, sizeof(sql), "SELECT * FROM webs WHERE `Direccion` = '%s'", resultx); mysql_query(sql); mysql_store_result(); if (mysql_num_rows() > 0) { mysql_fetch_row(row); split(row, arrCoords, '|'); mysql_free_result(); strmid(MYSQLWeb[id][Direccion], arrCoords[1], 0, strlen(arrCoords[1]), 255); strmid(MYSQLWeb[id][Texto1], arrCoords[2], 0, strlen(arrCoords[2]), 255); strmid(MYSQLWeb[id][Texto2], arrCoords[3], 0, strlen(arrCoords[3]), 255); strmid(MYSQLWeb[id][Texto3], arrCoords[4], 0, strlen(arrCoords[4]), 255); strmid(MYSQLWeb[id][Texto4], arrCoords[5], 0, strlen(arrCoords[5]), 255); strmid(MYSQLWeb[id][Texto5], arrCoords[6], 0, strlen(arrCoords[6]), 255); strmid(MYSQLWeb[id][Texto6], arrCoords[7], 0, strlen(arrCoords[7]), 255); //printf("%s %s %s %s ", MYSQLWeb[id][Texto1],MYSQLWeb[id][Texto2],MYSQLWeb[id][Texto3],MYSQLWeb[id][Texto4]); format(string, sizeof(string), " %s~n~ %s~n~%s~n~%s~n~%s~n~%s~n~", MYSQLWeb[id][Texto1],MYSQLWeb[id][Texto2],MYSQLWeb[id][Texto3],MYSQLWeb[id][Texto4], MYSQLWeb[id][Texto5],MYSQLWeb[id][Texto6]); TextDrawSetString(PantallaPCNavegadorX[playerid],string); JugadorNavegandoEscribeWeb[playerid] = false; return 1; } |