SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 04/01/2011, 11:16 AM   #1
*IsBack
Huge Clucker
 
*IsBack's Avatar
 
Join Date: Dec 2010
Posts: 237
Reputation: 3
Default Failed to exeute query. Lost connection to MySQL server during query.

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 Code:
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:
http://forum.sa-mp.com/showthread.php?t=122983

Other queries works OK, except this one..
__________________
From now on, I'm on this account: SiJ
*IsBack is offline  
Old 04/01/2011, 03:13 PM   #2
*IsBack
Huge Clucker
 
*IsBack's Avatar
 
Join Date: Dec 2010
Posts: 237
Reputation: 3
Default Re: Failed to exeute query. Lost connection to MySQL server during query.

So strange problem.. :S
__________________
From now on, I'm on this account: SiJ
*IsBack is offline  
Old 04/01/2011, 03:17 PM   #3
TehEbil
Little Clucker
 
Join Date: Jun 2009
Posts: 23
Reputation: 0
Default Re: Failed to exeute query. Lost connection to MySQL server during query.

What about the mysql_log? It may help.
TehEbil is offline  
Old 04/01/2011, 05:22 PM   #4
*IsBack
Huge Clucker
 
*IsBack's Avatar
 
Join Date: Dec 2010
Posts: 237
Reputation: 3
Default Re: Failed to exeute query. Lost connection to MySQL server during query.

Quote:
Originally Posted by TehEbil View Post
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.
__________________
From now on, I'm on this account: SiJ
*IsBack is offline  
Old 04/01/2011, 05:30 PM   #5
hanzen
Huge Clucker
 
Join Date: Apr 2009
Posts: 256
Reputation: 0
Default Re: Failed to exeute query. Lost connection to MySQL server during query.

Your MySQL doesn't seem to like you.
hanzen is offline  
Old 04/01/2011, 05:34 PM   #6
Calgon
Banned
 
Join Date: Jan 2009
Posts: 6,130
Reputation: 1127
Default Re: Failed to exeute query. Lost connection to MySQL server during query.

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).
Calgon is offline  
Old 04/01/2011, 05:49 PM   #7
*IsBack
Huge Clucker
 
*IsBack's Avatar
 
Join Date: Dec 2010
Posts: 237
Reputation: 3
Default Re: Failed to exeute query. Lost connection to MySQL server during query.

Quote:
Originally Posted by Calgon View Post
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?
__________________
From now on, I'm on this account: SiJ

Last edited by *IsBack; 05/01/2011 at 10:11 AM. Reason: Edit
*IsBack is offline  
Old 05/01/2011, 10:12 AM   #8
*IsBack
Huge Clucker
 
*IsBack's Avatar
 
Join Date: Dec 2010
Posts: 237
Reputation: 3
Default Re: Failed to exeute query. Lost connection to MySQL server during query.

This is still unsolved..
__________________
From now on, I'm on this account: SiJ
*IsBack is offline  
Old 05/01/2011, 07:32 PM   #9
Calgon
Banned
 
Join Date: Jan 2009
Posts: 6,130
Reputation: 1127
Default Re: Failed to exeute query. Lost connection to MySQL server during query.

Change your query to:

pawn Code:
UPDATE table SET field = '%s' WHERE id = %i

Strings belong in single-quotes and not integers.
Calgon is offline  
Old 06/01/2011, 08:45 AM   #10
*IsBack
Huge Clucker
 
*IsBack's Avatar
 
Join Date: Dec 2010
Posts: 237
Reputation: 3
Default Re: Failed to exeute query. Lost connection to MySQL server during query.

Quote:
Originally Posted by Calgon View Post
Change your query to:

pawn Code:
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.
__________________
From now on, I'm on this account: SiJ
*IsBack is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to do this? (MySQL query) hanzen Help Archive 5 03/01/2011 03:42 PM
MySQL Query Agent Smith Help Archive 4 30/08/2010 08:02 PM
[MySQL] samp-server quits when you run query dioguitosbr Help Archive 2 09/11/2009 07:03 PM
Server crash after sending query to mysql Vince Help Archive 0 15/07/2009 11:45 AM
mysql query. Think Help Archive 3 11/03/2009 05:27 PM


All times are GMT. The time now is 07:07 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.