server hangs during mysql query
#1

This is my error when I create a clan, the server hangs in the middle!! I dunno whether the query
is bugged or my code is bugged!


Код:
Mysql Log:
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
[19:05:44] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "[BS]"
[19:05:44] [DEBUG] cache_get_row - row: 0, field_idx: 0, connection: 1, max_len: 10
Reply
#2

Please show your code.
Reply
#3

Код:
case 2002: //add clan
	    {
	        if(response)
	        {
	            new query[300];
	            mysql_query(mysql,"SELECT * FROM `clans`");//,true,"","");
	            if(cache_num_rows() >= 30) return SendLangMessage(playerid,0xFF0000FF,"Es kцnnen nur 30 Clans existieren!","There can be only 30 Clans!","Solo puede haber 30 clanes!");
	            new length = strlen(inputtext);
	            if(length < 3 || length > 7) return SendLangMessage(playerid,0xFF0000FF,"Der Tag muss zwischen 3 und 6 Buchstaben haben. Beispiel: [TAG]","Tag must be between 3 and 6 characters. Example: [TAG]","La etiqueta debe tener entre 3 y 6 caracteres. Ejemplo: [TAG]");
	            if(strcmp(inputtext[0], "[", true, 1) || strcmp(inputtext[length-1], "]", true, 1)) return SendLangMessage(playerid,0xFF0000FF,"Der Tag muss geschlossen sein in Klammern. Beispiel: [TAG]","Tag must be inclosed in brackets. Example: [TAG]","La etiqueta debe ir entre corchetes. Ejemplo: [TAG]");
	            if(strfind(inputtext, " ", true) != -1) return SendLangMessage(playerid,0xFF0000FF,"Der Tag kann nicht Leerrдume besitzen!","Tag can not contain spaces!","La etiqueta no puede contener espacios!");
                if(cache_num_rows() > 0) return SendLangMessage(playerid,0xFF0000FF,"Dieser Clan existiert bereits!","This Clan already exists!","Este clan ya existe!");
			    mysql_format(mysql,query,sizeof(query),"SELECT * FROM `clans` WHERE `clan` = '%s'",inputtext);
	            mysql_query(mysql,query);//,true,"","");
				mysql_format(mysql,query,sizeof(query),"INSERT INTO `clans` (`clan`,`Clanscore`,`Tempscore`,`Info`,`Clanowner`,`Permission1`,`Permission2`,`Permission3`,`Permission4`,`Permission5`,`Permission6`,`woncws`,`lostcws`) VALUES ('%s',0,0,'No Info',0,5,5,5,5,5,5,0,0)",inputtext);
	            mysql_query(mysql,query);//,false,"","");
 				createClanDialog(playerid);
	        }
	        else
	        {
	            createClanDialog(playerid);
	        }
			return 1;
		}
Reply
#4

You have to improve your MySQL definetly... check this.
Reply
#5

Quote:
Originally Posted by DetoNater
Посмотреть сообщение
Код:
case 2002: //add clan
	    {
	        if(response)
	        {
	            new query[300];
	            mysql_query(mysql,"SELECT * FROM `clans`");//,true,"","");
	            if(cache_num_rows() >= 30) return SendLangMessage(playerid,0xFF0000FF,"Es kцnnen nur 30 Clans existieren!","There can be only 30 Clans!","Solo puede haber 30 clanes!");
	            new length = strlen(inputtext);
	            if(length < 3 || length > 7) return SendLangMessage(playerid,0xFF0000FF,"Der Tag muss zwischen 3 und 6 Buchstaben haben. Beispiel: [TAG]","Tag must be between 3 and 6 characters. Example: [TAG]","La etiqueta debe tener entre 3 y 6 caracteres. Ejemplo: [TAG]");
	            if(strcmp(inputtext[0], "[", true, 1) || strcmp(inputtext[length-1], "]", true, 1)) return SendLangMessage(playerid,0xFF0000FF,"Der Tag muss geschlossen sein in Klammern. Beispiel: [TAG]","Tag must be inclosed in brackets. Example: [TAG]","La etiqueta debe ir entre corchetes. Ejemplo: [TAG]");
	            if(strfind(inputtext, " ", true) != -1) return SendLangMessage(playerid,0xFF0000FF,"Der Tag kann nicht Leerrдume besitzen!","Tag can not contain spaces!","La etiqueta no puede contener espacios!");
                if(cache_num_rows() > 0) return SendLangMessage(playerid,0xFF0000FF,"Dieser Clan existiert bereits!","This Clan already exists!","Este clan ya existe!");
			    mysql_format(mysql,query,sizeof(query),"SELECT * FROM `clans` WHERE `clan` = '%s'",inputtext);
	            mysql_query(mysql,query);//,true,"","");
				mysql_format(mysql,query,sizeof(query),"INSERT INTO `clans` (`clan`,`Clanscore`,`Tempscore`,`Info`,`Clanowner`,`Permission1`,`Permission2`,`Permission3`,`Permission4`,`Permission5`,`Permission6`,`woncws`,`lostcws`) VALUES ('%s',0,0,'No Info',0,5,5,5,5,5,5,0,0)",inputtext);
	            mysql_query(mysql,query);//,false,"","");
 				createClanDialog(playerid);
	        }
	        else
	        {
	            createClanDialog(playerid);
	        }
			return 1;
		}
is this the full code ??
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)