[MySql Help] To retrieve a value from a MySQL database - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [MySql Help] To retrieve a value from a MySQL database (
/showthread.php?tid=189963)
[MySql Help] To retrieve a value from a MySQL database -
XePloiT - 13.11.2010
hmm.. i am kinda new at that mysql-pawno thing together....
well...i want to retrieve a value from a MySQL database...
how can i do that?
Re: [MySql Help] To retrieve a value from a MySQL database -
Rider13 - 25.11.2010
Little example
Code:
format(sql, sizeof(sql), "SELECT model FROM cars that WHERE id=%d", carid);
samp_mysql_query(sql);
samp_mysql_store_result();
if (samp_mysql_num_rows() == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, " Cant find ");
return 1;
}
samp_mysql_fetch_row(row);
new model = strval(row);