05.07.2012, 02:38
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:
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.
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;
}
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.