17.07.2007, 22:52
had an issue, but i solved it...it was posted here. i was being an idiot
new resultline[1024]; samp_mysql_connect("127.0.0.1", "root", ""); //replace with the good params samp_mysql_select_db("test"); //replace with the good database samp_mysql_query("SELECT * FROM members"); //replace with the good query samp_mysql_store_result(); while(samp_mysql_fetch_row(resultline)) { printf("%s\n", resultline); } samp_mysql_close();
public billboard(playerid){
new conBillboard;
conBillboard = samp_mysql_connect(mysqlhost, mysqluser, mysqlpassword);
if(conBillboard == 0){
SendClientMessage(playerid,red,"Error connecting to mysql database. Please notify administrator.");
}else{
samp_mysql_select_db(mysqldb);
samp_mysql_query("select entry from billboard order by id");
samp_mysql_store_result();
new string[1024];
while(samp_mysql_fetch_row(string)){
printf("%s\n",string);
}
samp_mysql_close();
}
SetTimer("billboard",120000,0);
return 1;
}
Originally Posted by Flyin
fluid !
Quote:
|
Originally Posted by [RAZ
ADreNaLiNe-DJ ]
The new one is fixed... And if you look the Pawn example, you'll see a "very beautiful working" while loop... |
Originally Posted by [RAZ
ADreNaLiNe-DJ ]
The inconvenient of MySQL is to send and receive something to another program (MySQL), waiting for reply,... But the advantage is that you can make queries. Queries are like filters on data that you don't have in flat files. Is it a solution using SQL-Lite ? It depends on the use of the database, if databse is also used by a website, MySQL is best to a better handling of multi-threading. |