MySQL string to variable
#19

Ive just tried some new things, and now with a different command it does load the string in to a variable.

pawn Код:
CMD:showteles( playerid, params[] )
{
    new query[128];

    for( new i = 1; i < MAX_TELES; i ++ )
    {
        format( query, sizeof query, "SELECT teleportid, teleportcmd FROM teleports WHERE teleportid = %i", i );
        mysql_function_query( g_Handle, query, true, "ShowTeles", "i", playerid );
    }
    return 1;
}

forward ShowTeles( playerid );
public ShowTeles( playerid )
{
    new num, row, fetchid, fetchcmd[50], pString[128];
    cache_get_data( num, row, g_Handle );
    if( row )
    {
        fetchid = cache_get_row_int( 0, 0, g_Handle );
        cache_get_row( 0, 1, fetchcmd, g_Handle );

        format( pString, sizeof pString, "TeleportID: %i | TeleportCommand: /%s", fetchid, fetchcmd );
        SendClientMessage( playerid, -1, pString );
    }
    return 1;
}
Both codes are practically the same.
Reply


Messages In This Thread
MySQL string to variable - by Wesley221 - 29.04.2013, 18:17
Re: MySQL string to variable - by MP2 - 30.04.2013, 08:33
Re: MySQL string to variable - by AndreT - 30.04.2013, 08:51
Re: MySQL string to variable - by MP2 - 30.04.2013, 08:53
Re: MySQL string to variable - by AndreT - 30.04.2013, 10:19
Re: MySQL string to variable - by MP2 - 30.04.2013, 10:42
Re: MySQL string to variable - by AndreT - 30.04.2013, 12:30
Re: MySQL string to variable - by MP2 - 30.04.2013, 12:37
Re: MySQL string to variable - by Wesley221 - 30.04.2013, 13:48
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 15:24
Re: MySQL string to variable - by Calabresi - 02.05.2013, 18:07
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 18:13
Re: MySQL string to variable - by Calabresi - 02.05.2013, 18:19
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 18:24
Re: MySQL string to variable - by Calabresi - 02.05.2013, 18:28
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 18:35
Re: MySQL string to variable - by Calabresi - 02.05.2013, 18:48
Re: MySQL string to variable - by Wesley221 - 02.05.2013, 19:37
Re: MySQL string to variable - by Wesley221 - 03.05.2013, 17:43
Re: MySQL string to variable - by Scenario - 03.05.2013, 17:51
Re: MySQL string to variable - by Wesley221 - 03.05.2013, 19:32
Re: MySQL string to variable - by InfiniTy. - 03.05.2013, 19:41
Re: MySQL string to variable - by Wesley221 - 03.05.2013, 20:32
Re: MySQL string to variable - by InfiniTy. - 03.05.2013, 20:51
Re: MySQL string to variable - by Wesley221 - 04.05.2013, 13:54
Re: MySQL string to variable - by InfiniTy. - 04.05.2013, 14:39
Re: MySQL string to variable - by Wesley221 - 04.05.2013, 15:13
Re: MySQL string to variable - by Wesley221 - 05.05.2013, 14:16

Forum Jump:


Users browsing this thread: 1 Guest(s)