03.02.2010, 09:35
Awesome, good to see you keep updating it!
delete cfield; char *err = new char[128]; sprintf((char *)err, "'mysql_fetch_field' could not find field: '%s'.", cfield); GenerateError(h, (const char *)err, P_ERROR_NOFIELD); delete [] err; return 0;
while(mysql_fetch_row(..)) { mysql_fetch_field("blah",dest); mysql_fetch_field("blah",dest); mysql_fetch_field("blah",dest); }
mysql_query("SELECT * FROM `houses`"); mysql_store_result(); new buffer[64]; new int i = 0; while(mysql_fetch_row_data()) { mysql_fetch_field("X", buffer); // Here you would set the house X coord to: floatstr(buffer); mysql_fetch_field("Y", buffer); // Here you would set the house Y coord to: floatstr(buffer); mysql_fetch_field("Z", buffer); // Here you would set the house Z coord to: floatstr(buffer); mysql_fetch_field("owner", buffer); // Here you would set the house owner to: strval(buffer); mysql_fetch_field("price", buffer); // Here you would set the house price to: strval(buffer); i++; } printf("%d total houses loaded.", i); mysql_free_result();
mysql_query("SELECT * FROM `accounts` where `name` = 'PLAYERNAME'"); mysql_store_result(); new buffer[64]; if(mysql_fetch_row_data()) { mysql_fetch_field("money", buffer); // Here you would set the players money to: strval(buffer); mysql_fetch_field("kills", buffer); // Here you would set the players kills to: strval(buffer); mysql_fetch_field("deaths", buffer); // Here you would set the players deaths to: strval(buffer); // Set variable that the player is logged in. mysql_free_result(); } else { // No rows could be fetched thus the account does not exist. }
mysql.inc(24) : error 010: invalid function or declaration mysql.inc(24) : error 001: expected token: ";", but found "-identifier-" mysql.inc(25) : error 010: invalid function or declaration mysql.inc(25) : error 001: expected token: ";", but found "-identifier-" mysql.inc(26) : error 010: invalid function or declaration mysql.inc(26) : error 001: expected token: ";", but found "-identifier-" mysql.inc(30) : error 010: invalid function or declaration mysql.inc(31) : error 010: invalid function or declaration mysql.inc(31) : error 001: expected token: ";", but found "-identifier-" mysql.inc(32) : error 010: invalid function or declaration mysql.inc(32) : error 001: expected token: ";", but found "-identifier-" mysql.inc(33) : error 010: invalid function or declaration mysql.inc(33) : error 001: expected token: ";", but found "-identifier-" mysql.inc(34) : error 010: invalid function or declaration mysql.inc(34) : error 001: expected token: ";", but found "-identifier-" mysql.inc(35) : error 010: invalid function or declaration mysql.inc(35) : error 001: expected token: ";", but found "-identifier-" mysql.inc(36) : error 010: invalid function or declaration mysql.inc(36) : error 001: expected token: ";", but found "-identifier-" mysql.inc(37) : error 010: invalid function or declaration mysql.inc(37) : error 001: expected token: ";", but found "-identifier-" mysql.inc(38) : error 010: invalid function or declaration mysql.inc(38) : error 001: expected token: ";", but found "-identifier-" mysql.inc(39) : error 010: invalid function or declaration mysql.inc(39) : error 001: expected token: ";", but found "-identifier-" mysql.inc(40) : error 010: invalid function or declaration
Originally Posted by Bacovsky
Код:
mysql.inc(24) : error 010: invalid function or declaration mysql.inc(24) : error 001: expected token: ";", but found "-identifier-" mysql.inc(25) : error 010: invalid function or declaration mysql.inc(25) : error 001: expected token: ";", but found "-identifier-" mysql.inc(26) : error 010: invalid function or declaration mysql.inc(26) : error 001: expected token: ";", but found "-identifier-" mysql.inc(30) : error 010: invalid function or declaration mysql.inc(31) : error 010: invalid function or declaration mysql.inc(31) : error 001: expected token: ";", but found "-identifier-" mysql.inc(32) : error 010: invalid function or declaration mysql.inc(32) : error 001: expected token: ";", but found "-identifier-" mysql.inc(33) : error 010: invalid function or declaration mysql.inc(33) : error 001: expected token: ";", but found "-identifier-" mysql.inc(34) : error 010: invalid function or declaration mysql.inc(34) : error 001: expected token: ";", but found "-identifier-" mysql.inc(35) : error 010: invalid function or declaration mysql.inc(35) : error 001: expected token: ";", but found "-identifier-" mysql.inc(36) : error 010: invalid function or declaration mysql.inc(36) : error 001: expected token: ";", but found "-identifier-" mysql.inc(37) : error 010: invalid function or declaration mysql.inc(37) : error 001: expected token: ";", but found "-identifier-" mysql.inc(38) : error 010: invalid function or declaration mysql.inc(38) : error 001: expected token: ";", but found "-identifier-" mysql.inc(39) : error 010: invalid function or declaration mysql.inc(39) : error 001: expected token: ";", but found "-identifier-" mysql.inc(40) : error 010: invalid function or declaration |
[Tue Feb 16 21:51:27 2010] Error (0): Callback: OnMysqlQuery not found.
public OnMysqlQuery(resultid, spareid, MySQL:connection)
{
switch(resultid)
{
// Code
}
return 1;
}
Originally Posted by MenaceX^
Quote:
|
if (!mysql_real_connect(my[h].mysql, host, user, pass, db, 0, NULL, 0)) { delete host; delete user; delete pass; delete db; GenerateError(h, "Failed to connect.", mysql_errno(my[h].mysql)); return -1; } mysql_options(my[h].mysql, MYSQL_OPT_RECONNECT, &my[h].reconnect); logprintf("MySQL: Connected (%d) to %s @ %s. MySQL version %s.", h, user, mysql_get_host_info(my[h].mysql), mysql_get_server_info(my[h].mysql)); if (my[h].logging == LOG_ALL) Log("Connected (%d) to %s @ %s. MySQL version %s.", h, user, mysql_get_host_info(my[h].mysql), mysql_get_server_info(my[h].mysql)); delete host; delete user; delete pass; delete db; my[h].connected = true; return h;
if (mysql_real_connect(my[h].mysql, host, user, pass, db, 0, NULL, 0)) { mysql_options(my[h].mysql, MYSQL_OPT_RECONNECT, &my[h].reconnect); logprintf("MySQL: Connected (%d) to %s @ %s. MySQL version %s.", h, user, mysql_get_host_info(my[h].mysql), mysql_get_server_info(my[h].mysql)); if (my[h].logging == LOG_ALL) Log("Connected (%d) to %s @ %s. MySQL version %s.", h, user, mysql_get_host_info(my[h].mysql), mysql_get_server_info(my[h].mysql)); my[h].connected = true; } else { GenerateError(h, "Failed to connect.", mysql_errno(my[h].mysql)); h = -1; } delete host; delete user; delete pass; delete db; return h;
Originally Posted by Jack_Fox
Hi,
I'm having problems with my gothfather script, when I send 6 UPDATE queries, it stops and starts updating all the stats over and over again... (but not all of them) Maybe because the memory is full or something else.. will it help when I put them in threads? Grrtz, Jack_fox |
Originally Posted by »Julian™«
Ok guys due I am not a pro MYSQL coder I need someone to add me on msn and go true my GM to transfer hole it into MYSQL I know you want money for that but to bad I got no cash for it .. What can I offer them? Admin , Scripter position , Credits or something similar just add my msn
brunchy@serverz4life.co.uk and we can discuss about it . I would appreciate if stricten added me on msn and helped me out or anyone else to :P |
Originally Posted by MenaceX^
Quote:
|
Originally Posted by »Julian™«
Quote:
|
Originally Posted by MenaceX^
Quote:
|