SA-MP Forums Archive
[Plugin] [REL]SAMP-MySQL v0.15 - SAMP 0.3 supported!!! corrected version uploaded... - 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: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: [Plugin] [REL]SAMP-MySQL v0.15 - SAMP 0.3 supported!!! corrected version uploaded... (/showthread.php?tid=7106)

Pages: 1 2 3 4 5 6


Re: [REL] SAMP-MySQL and SAMP-MYSQL-lite v0.11 (last edit 07-16-2007) - fluid - 17.07.2007

had an issue, but i solved it...it was posted here. i was being an idiot


Re: [REL] SAMP-MySQL and SAMP-MYSQL-lite v0.11 (last edit 07-16-2007) - fluid - 18.07.2007

if i do a while loop like that, how do i access the data as the loop runs? everything i try crashes the server.


Re: [REL] SAMP-MySQL and SAMP-MYSQL-lite v0.11 (last edit 07-16-2007) - fluid - 18.07.2007

try to use timer? (and im having problems editing posts! dont know why)


Re: [REL] SAMP-MySQL and SAMP-MYSQL-lite v0.11 (last edit 07-16-2007) - ADreNaLiNe-DJ - 18.07.2007

here is a sample code for your loop:
Code:
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();



Re: [REL] SAMP-MySQL and SAMP-MYSQL-lite v0.11 (last edit 07-16-2007) - fluid - 18.07.2007

lets see if posting is fixed here...

pawn Code:
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;  
}
thats what im doing. it causes a server crash as soon as a player connects. as best i can tell, i am doing the exact same thing you are doing.

the database is working, the userid, password, and mysqldb are all set correctly because i use them in a vehicle spawn function (that looks up vehicle id's in a sql table based on their name)...

its only when i am doing the while loop that things break.

for windows, i am using your executables entirely. on linux, i compiled the plugin, and am using a precompiled libmysqlclient from 5.0.41

as for the double post above, i apologize...but this site was having tremendous difficulty in doing anything with large posts earlier

i dont see the point of complaining about double posting on a forum anyway. if you dont do it at times, it completely does away with the intended purpose of "show new replies to your posts". this is my opinion, and thats all it is. i dont make the rules here, nor do i enforce them. i try and follow them as best i can, but with the site doing what it was doing earlier, there was no way around it.



Re: [REL]SAMP-MySQL and SAMP-MYSQL-lite v0.11 (last edit 07-18-2007 => see 1st post) - ADreNaLiNe-DJ - 18.07.2007

Now, the project is hosted on dev.sa-mp.com.
Click here to see the page.


Re: [REL]SAMP-MySQL and SAMP-MYSQL-lite v0.11 (last edit 07-18-2007 => see 1st p - fluid - 18.07.2007

well, i dont know what i did...but somewhere between switching from the broken WHILE, to the working FOR, on to a working WHILE...i arrived back at a WHILE that was broken...i deleted the entire function and tried to rewrite it several times as a while...loop to no avail. it just crashed the server each time i connected.

im back to the working for...loop for now, and im perfectly happy with that. lol...ive never used while loops before, i have no idea why i decided to start when i read this thread. lol...


Re: [REL]SAMP-MySQL and SAMP-MYSQL-lite v0.11 (last edit 07-18-2007 => see 1st post) - ADreNaLiNe-DJ - 18.07.2007

Quote:
Originally Posted by Flyin
fluid !
Quote:

« Last Edit: Today at 11:10:49 AM by fluid »

:} GZ
lol...
After becoming a "good loop scripter", he'll become a good post "editor"...


Re: [REL]SAMP-MySQL and SAMP-MYSQL-lite v0.11 (last edit 07-18-2007 => see 1st p - fluid - 18.07.2007

actually, i talked to someone on irc, and they did say they were having problems with the machine these forums are on...but that the person who could fix it was asleep...soooooo :P


Re: [REL]SAMP-MySQL v0.12 (last edit 07-18-2007 => see 1st post) - ADreNaLiNe-DJ - 18.07.2007

New Release is out !!!

Check out it HERE


Re: [REL]SAMP-MySQL v0.12 (last edit 07-18-2007 => see 1st post) - courage - 18.07.2007

What did you add/Fix?

strtok, ping?
Ok, lets ping each other xD


Re: [REL]SAMP-MySQL v0.12 (last edit 07-18-2007 => see 1st post) - ADreNaLiNe-DJ - 18.07.2007

Take a look to the official page (link is in the first post of the topic)...


Re: [REL]SAMP-MySQL v0.12 (last edit 07-18-2007 => see 1st post) - fluid - 18.07.2007

while...loop works exactly as i did it before (when it didnt work). i am using your .so file though instead of compiling my own...so i dont know if something was wrong with mine, or you made some change that fixed it.


Re: [REL]SAMP-MySQL v0.12 (last edit 07-18-2007 => see 1st post) - ADreNaLiNe-DJ - 18.07.2007

The new one is fixed...

And if you look the Pawn example, you'll see a "very beautiful working" while loop...


Re: [REL]SAMP-MySQL v0.12 (last edit 07-18-2007 => see 1st post) - fluid - 19.07.2007

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...
well my not-very-beautifully-working while loop is now very-beautifully-working ... hehe...

this rocks btw...i seriously sat around wishing the other day that i didnt have to stuff so much crap into an array the other day (vehicle data), and then use rudimentary array functions on it to find what i needed...

i love it, and a lot of us appreciate it...

you should do some simple benchmark tests, just to see what reading a populated table, and looping each of the records is like as opposed to a script that uses the filesystem to do the same... there was a miniargument today on irc about mysql being slower than the way most people store their data (flat files). hehe...


Re: [REL]SAMP-MySQL v0.12 (last edit 07-18-2007 => see 1st post) - ADreNaLiNe-DJ - 19.07.2007

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.


Re: [REL]SAMP-MySQL v0.12 (last edit 07-18-2007 => see 1st post) - fluid - 19.07.2007

Quote:
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.
i agree with that 100%...it also keeps your freaking filesystem clean. lol...id just love to see how long the filesystem takes to loop through 4896 users created with dudb (not saying dudb is bad, its great!) in comparison to 4896 users in a mysql table...

mysql would be in milliseconds...cause we did a table that size last night and thats how long it took to select and give back the resultset for all rows. hehe...


Re: [REL]SAMP-MySQL v0.12 (last edit 07-18-2007 => see 1st post) - ADreNaLiNe-DJ - 19.07.2007

If you can give me your table, i'll make some tests...

I'll give you results and my "server" specification (not really a server, it's a too old pc...).


Re: [REL]SAMP-MySQL v0.12 (last edit 07-18-2007 => see 1st post) - 50p - 19.07.2007

Crashes windows server if failed to connect to mysql server.


Re: [REL]SAMP-MySQL v0.12 (last edit 07-18-2007 => see 1st post) - ADreNaLiNe-DJ - 19.07.2007

It's a known bug, read the Installation Notes !!!

If you make "your job" to get all returned values by function you can prevent from crashing...