[Ajuda] Pegar id na tabela veiculos mysql
#2

Nгo entendi o propуsito disso, no exemplo abaixo fiz uma consulta para pegar o modelo.

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
GetVehicleColor(vehicleid, ColorOne, ColorTwo);
format(Query, sizeof(Query), "SELECT * FROM vehicles WHERE id = '%i'", VehicleInfo[id]);
mysql_function_query(Conexao, Query, true, "getVehicleInformation", "d", playerid);



forward getVehicleInformation(playerid);
public getVehicleInformation(playerid) {

    new linhas_c, colunas_c;
    cache_get_data(linhas_c, colunas_c, Conexao);

    if (linhas_c == 0 )
        SendClientMessage(playerid, -1, "Nenhum resultado encontrado!");
    else {
        new result[25], model;
        cache_get_field_content(0, "model", result, Conexao);
        model = strval(result);
        format (str, 25, "Modelo й %d", id);
        SendClientMessage(playerid, -1, str);
    }
    return 1;
}
A formataзгo da Query fica com vocк!
Reply


Messages In This Thread
Pegar id na tabela veiculos mysql - by Alexbav - 12.01.2014, 02:25
Re: Pegar id na tabela veiculos mysql - by Gii - 12.01.2014, 02:36
Re: Pegar id na tabela veiculos mysql - by smiiir - 12.01.2014, 12:21
Re: Pegar id na tabela veiculos mysql - by Alexbav - 12.01.2014, 13:59
Re: Pegar id na tabela veiculos mysql - by Alexbav - 12.01.2014, 14:33
Re: Pegar id na tabela veiculos mysql - by Alexbav - 12.01.2014, 23:41
Re: Pegar id na tabela veiculos mysql - by Kmatsu - 13.01.2014, 00:05
Re: Pegar id na tabela veiculos mysql - by Alexbav - 13.01.2014, 00:08
Re: Pegar id na tabela veiculos mysql - by Kmatsu - 13.01.2014, 00:33
Re: Pegar id na tabela veiculos mysql - by Alexbav - 13.01.2014, 00:35

Forum Jump:


Users browsing this thread: 1 Guest(s)