(mysql) Select 5 random houseid's without calling the query 5 times?
#5

Edit: i see what i did wrong, thanks.

pawn Код:
mysql_query("SELECT `Houseid` FROM `Houses` WHERE `Owner` != 'Unbought' ORDER BY RAND() LIMIT 5");
    mysql_store_result();
    new Query[16], m_Houseid[5];
    while(mysql_fetch_row_format(Query))
    {
        static c_House = 0;
        sscanf(Query, "p<|>i", m_Houseid[c_House]);
        c_House++;
    }
    printf("H1: %d - H2: %d - H3: %d - H4: %d - H5: %d - Query: %s", m_Houseid[0], m_Houseid[1], m_Houseid[2], m_Houseid[3], m_Houseid[4], Query);
worked perfectly
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)