MySQL retrieve data from column?
#1

Is there anyways to retrieve the data from a whole column and somehow store it into a variable and display it in a dialog?

Here's what I have:
pawn Код:
CMD:watchlist(playerid, params[])
{
    new result[24];
    mysql_query("SELECT * FROM `watchlist`"); // select all from watchlist
    mysql_store_result(); // store the result
    if(mysql_retrieve_row())
    {
        mysql_fetch_field_row(result, "player");
        printf("Result: %s", result); // Attempting to display the result (which only displays the first row)
        mysql_fetch_field_row(result, "player");
        printf("Result: %s", result); // Has the same result as above (same name shows)
    }
    mysql_free_result();
    return 1;
}
This command basically reads the table 'watchlist' from MySQL, and im hoping to display it in a dialog, but just can't find the right method.

I've thought of just making new columns (up to 5) instead of storing all the names in 1 column but that would make it so inefficient and requires alot more code.
Reply


Messages In This Thread
MySQL retrieve data from column? - by DBan - 05.07.2012, 02:38
Re: MySQL retrieve data from column? - by iGetty - 05.07.2012, 02:45
Re: MySQL retrieve data from column? - by DBan - 05.07.2012, 03:10
Re: MySQL retrieve data from column? - by Sinner - 05.07.2012, 06:44
Re: MySQL retrieve data from column? - by ReneG - 05.07.2012, 09:37

Forum Jump:


Users browsing this thread: 1 Guest(s)