MySQL help
#7

Forget it, I fixed that problem myself, but now I have a new one
When I try and get information from the SQL db and place it into one of my variables thats what it writes:
PHP код:
[Sun Jul 10 18:59:02 2011Error (0): Function: mysql_store_result called when no prior successful query executed.
[
Sun Jul 10 18:59:02 2011Error (0): Function: mysql_store_result called when no result stored
How did I try and get and put:
PHP код:
PlayerInfo[playerid][pJob] = mysql_Int(SQL_USERS,PlayerInfo[playerid][pUID],"job"); 
mysql_Int function is something I built:
PHP код:
stock mysql_Int(table[],id,key[])
{
    return 
strval(mysql_Get(table,id,key));

mysql_Get:
PHP код:
stock mysql_Get(table[],id,key[])
{
    
Query("SELECT `%s` FROM `%s` WHERE `userid` = '%d'",key,table,id);
    new 
Result[30];
    
mysql_fetch_row_format(Result);
    return 
Result;

mysql_fetch_row_format:
PHP код:
#define mysql_fetch_row_format(%1) mysql_fetch_row(%1,"|") 
Query:
PHP код:
new false;
#if defined Query
#else
    #define Query(%1,%2) do { new formatStr[256]; format(formatStr,sizeof(formatStr),%1,%2); if(SQL_Connection) mysql_query(formatStr); mysql_store_result(); } while(F)
#endif
#pragma unused F 
I use StrickenKid's plugin and all the mysql_Get & mysql_Int are inside the "mysql.inc" file.
Reply


Messages In This Thread
MySQL help - by [IL]HeHu - 10.07.2011, 11:55
Re: MySQL help - by Vince - 10.07.2011, 13:15
Re: MySQL help - by [IL]HeHu - 10.07.2011, 14:59
Re: MySQL help - by [NoV]LaZ - 10.07.2011, 15:06
Re: MySQL help - by [IL]HeHu - 10.07.2011, 15:09
Re: MySQL help - by [NoV]LaZ - 10.07.2011, 16:25
Re: MySQL help - by [IL]HeHu - 10.07.2011, 16:57
Re: MySQL help - by [NoV]LaZ - 10.07.2011, 17:06
Re: MySQL help - by [IL]HeHu - 10.07.2011, 17:13
Re: MySQL help - by [IL]HeHu - 10.07.2011, 18:53

Forum Jump:


Users browsing this thread: 1 Guest(s)