[Ajuda] Database SQL
#6

Consegui jб, obrigado

Код:
gs_Buffer[0] = EOS;
    strcat(gs_Buffer, "CREATE TABLE IF NOT EXISTS `contas`(");
    for(new i; i < sizeof(TabelaPlayer); i ++)
    {
        strcat(gs_Buffer, fmat_return("%s %s %s%s", TabelaPlayer[i][tabela_nome], TabelaPlayer[i][tabela_tipo], TabelaPlayer[i][tabela_padrao], TabelaPlayer[i][tabela_fechamento]));
    }
    db_free_result(db_query(DatabaseBSP, gs_Buffer));

    for(new i; i < sizeof(TabelaPlayer); i ++)
    {
        Result = db_query(DatabaseBSP, fmat_return("SELECT `%s` FROM `contas`;", TabelaPlayer[i][tabela_nome]));
        if(!db_num_rows(Result))
        {
            db_free_result(db_query(DatabaseBSP, fmat_return("ALTER TABLE `contas` ADD %s %s %s;", TabelaPlayer[i][tabela_nome], TabelaPlayer[i][tabela_tipo], TabelaPlayer[i][tabela_padrao])));
        }
        db_free_result(Result);
    }
Reply


Messages In This Thread
Database SQL - by Paulthaz - 22.11.2017, 10:52
Re: Database SQL - by Buda - 22.11.2017, 11:06
Re: Database SQL - by Paulthaz - 22.11.2017, 11:54
Re: Database SQL - by Paulthaz - 22.11.2017, 11:56
Re: Database SQL - by Buda - 22.11.2017, 12:05
Re: Database SQL - by Paulthaz - 22.11.2017, 13:02

Forum Jump:


Users browsing this thread: 1 Guest(s)