MySQL data taking problems. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: MySQL data taking problems. (
/showthread.php?tid=228751)
MySQL data taking problems. -
Vidma - 20.02.2011
Hi, i have one problem. Can you help me?
Thanks.
I have one command: /newspaper
i need to take all data from my mysql table "Newspaper" from row "Text"
COMMAND:newspaper(playerid,params[])
{
new Query[200];
new result[50];
format(Query, sizeof(Query), "SELECT * FROM `Newspaper`");
mysql_store_result();
mysql_fetch_field_row(result,"Text");
SendClientMessage(playerid, COLOR_BALTA, result);
mysql_free_result();
return 1;
}
What i do bad? It not works, it shows only blank text. Can you help me, or can you do that command, who takes and shows all data from "Text" row? Thank you,
Vidma.
Re: MySQL data taking problems. -
kLx - 20.02.2011
pawn Code:
COMMAND:newspaper( playerid, params[ ] )
{
new
row[ 128 ];
mysql_query ( "SELECT * FROM `Newspaper`" );
mysql_store_result ( );
mysql_fetch_row ( row );
SendClientMessage( playerid, -1, row );
mysql_free_result ( );
}
Bandyk..
Re: MySQL data taking problems. -
Vidma - 20.02.2011
Vistiek neveikia. Dabar nieko nerašo.
Anyway, not works.
Re: MySQL data taking problems. -
Vidma - 22.02.2011
Anyone can help to me?