[MySql Help] To retrieve a value from a MySQL database
#1

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?
Reply
#2

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);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)