21.09.2011, 19:34
Nice work!
SELECT * FROM gangs WHERE name='Grove Street' OR shortname='GS'
[14:44:37] CMySQLHandler::Query(SELECT * FROM gangs WHERE name='Grove Street' OR shortname='GS') - Successfully executed. [14:44:37] >> mysql_num_rows( Connection handle: 1 ) [14:44:37] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection) [14:44:37] >> mysql_ping( Connection handle: 1 )
Tell me how can I get this code of such a request. What would it take some data from the database.
Код:
format(query,sizeof(query),"SELECT date1, date2, date3, date4, ..., datan FROM players WHERE id=%d AND Password='%s' LIMIT 1",id,password); How can this be done? Just do not say do SELECT * .... Because in addition to the required fields, I have a lot of extra fields. Including text and they are only needed for the site. |
Hi, I am a Pole, I'm sorry for my English.
I have a table `gangs` that consists of these fields: `gid` (index), `leader`, `name`, `shortname`, `created` The table is empty. Then send query: Код:
SELECT * FROM gangs WHERE name='Grove Street' OR shortname='GS' Here is the log Код:
[14:44:37] CMySQLHandler::Query(SELECT * FROM gangs WHERE name='Grove Street' OR shortname='GS') - Successfully executed. [14:44:37] >> mysql_num_rows( Connection handle: 1 ) [14:44:37] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection) [14:44:37] >> mysql_ping( Connection handle: 1 ) |
new query[256]; format(query, sizeof(query), "SELECT * FROM `positions` WHERE `Name` = '%s'", name); mysql_query(query); mysql_store_result(); if (mysql_retrieve_row()) { printf("num fields: %d", mysql_num_fields()); new value[256]; mysql_fetch_field(1, value); printf("field 1: %s", value); }
[21:24:10] >> mysql_query( Connection handle: 1 ) [21:24:10] CMySQLHandler::Query(SELECT * FROM `positions` WHERE `Name` = 'test') - Successfully executed. [21:24:10] >> mysql_store_result( Connection handle: 1 ) [21:24:10] CMySQLHandler::StoreResult() - Result was stored. [21:24:10] >> mysql_retrieve_row( Connection handle: 1 ) [21:24:10] >> mysql_num_fields( Connection handle: 1 ) [21:24:10] CMySQLHandler::NumFields() - Returned 5 field(s) [21:24:10] >> mysql_fetch_field( Connection handle: 1 )
I have problem with this plugin. The server keeps freezing randomly, not crashing, freezing. People only see connected to server, and nothing after it. Server responds to nothing, and has to be forced to restart.
This isn't caused by some specific query or function, every function works, randomly server just freezes. Sometimes server stays up for week without freezes, sometimes just for day. I am using threaded mysql, code is written in OnQueryFinish. Server is running on linux, players usually from 50 to 80, latest SA-MP server, latest plugin. Do you have any idea what could cause these freezes? could it be incorrectly written script, if so, what is wrong, or too many queries at the same time? Help appreciated. |