Failed to exeute query. Lost connection to MySQL server during query.
#1

Hi,
I got this strange problem.. I get this:
Quote:

[Tue Jan 04 14:15:45 2011] Function: mysql_query executed: "UPDATE `table` SET `field`='101,103,' WHERE (`id` = '1')" with result: "1".
[Tue Jan 04 14:15:45 2011] Error (0): Failed to exeute query. Lost connection to MySQL server during query.

And the pawn code is:
pawn Код:
MySQLCheck();
            new items[20] = "",queryStr[150];
            if(GPS[playerid] == 1)
            {
                format(items,20,"%i,",ITEM_GPS);
            }
            if(Phone[playerid] == 1)
            {
                format(items,20,"%s%i,",items,ITEM_PHONE);
            }
            if(hMetter[playerid] == 1)
            {
                format(items,20,"%s%i,",items,ITEM_HEALTH);
            }
            if(Radio[playerid] == 1)
            {
                format(items,20,"%s%i,",items,ITEM_RADIO);
            }
            format(queryStr,150,"UPDATE `table` SET `field`='%s' WHERE (`id` = '%i')",items,GetPVarInt(playerid, "pID"));
            mysql_query(queryStr);
Why it disconnects from mysql server?
If I try to put this query:
Quote:

UPDATE `table` SET `field`='101,103,' WHERE (`id` = '1')

through phpMyAdmin, it works with no problems.. :S

I'm using this mysql plugin:
https://sampforum.blast.hk/showthread.php?tid=122983

Other queries works OK, except this one..
Reply
#2

So strange problem.. :S
Reply
#3

What about the mysql_log? It may help.
Reply
#4

Quote:
Originally Posted by TehEbil
Посмотреть сообщение
What about the mysql_log? It may help.
It doesn't:

Quote:

[Tue Jan 04 14:15:45 2011] Function: mysql_query executed: "UPDATE `table` SET `field`='101,103,' WHERE (`id` = '1')" with result: "1".
[Tue Jan 04 14:15:45 2011] Error (0): Failed to exeute query. Lost connection to MySQL server during query.
[Tue Jan 04 14:21:30 2011] Function: mysql_ping executed with result: "1".

And after this, all other queries goes like this:
Quote:

[Tue Jan 04 14:21:30 2011] Error (0): Could not execute query. MySQL server has gone away.

Reply
#5

Your MySQL doesn't seem to like you.
Reply
#6

I know what the problem is, but according your signature, "You [I] don't want to talk to [you] me." due to my age (b).
Reply
#7

Quote:
Originally Posted by Calgon
Посмотреть сообщение
I know what the problem is, but according your signature, "You [I] don't want to talk to [you] me." due to my age (b).
Ok.. fixed my signature.. :/
Hopefully we can talk now?
Reply
#8

This is still unsolved..
Reply
#9

Change your query to:

pawn Код:
UPDATE table SET field = '%s' WHERE id = %i
Strings belong in single-quotes and not integers.
Reply
#10

Quote:
Originally Posted by Calgon
Посмотреть сообщение
Change your query to:

pawn Код:
UPDATE table SET field = '%s' WHERE id = %i
Strings belong in single-quotes and not integers.
Does not help..
Here's how my query looks now:
Quote:

[Thu Jan 06 11:47:58 2011] Function: mysql_query executed: "UPDATE table SET field='101,103,' WHERE id = 1" with result: "1"." with result: "1".
[Thu Jan 06 11:47:58 2011] Error (0): Failed to exeute query. Lost connection to MySQL server during query.

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)