Posts: 399
Threads: 9
Joined: Dec 2010
Reputation:
0
I'm just using the latest download. I'm running windows 7 64 bit(could that be the problem?)
Posts: 845
Threads: 3
Joined: Jun 2010
No, just install that:
http://www.microsoft.com/en-us/downl....aspx?id=30679
Do you also have the libmysql.dll in the right place?
Posts: 399
Threads: 9
Joined: Dec 2010
Reputation:
0
Ah thank you so much. x86 version worked.
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
In regards to documentation, why do you need to use the SA-MP wiki? I don't think the SA-MP wiki should be used to document plugins - only SA-MP itself. Can't you get your own wiki, or just document it in a post? That being said, I have a wiki account so could help with documentation.
Posts: 845
Threads: 3
Joined: Jun 2010
Good idea, I'll create an own wiki.
Why use the SA-MP wiki?
https://sampwiki.blast.hk/wiki/MySQL
Thats why. But let's just leave this as the documentation for the older plugins which still support unthreaded queries.
Posts: 845
Threads: 3
Joined: Jun 2010
That would be too overkill. If I'd use the ****** code wiki, there would be 26 pages for each function (and 44 pages with R33!). And as you can currently see if you look at the wiki, that would just look disgusting.
I also don't like the syntax there, there is almost no chance to make it look like in the SA-MP wiki (which is my goal).
Posts: 845
Threads: 3
Joined: Jun 2010
Quote:
Originally Posted by MP2
You could just get a free wiki.
Anyway, when using R7, I did this to retrieve the rows in a while loop and put them in a string with delimiters:
pawn Код:
while(mysql_fetch_row_format(dest))
but that doesn't seem to work in R29 (mysql_fetch_row_format doesn't seem to return a value). How would I (using cache) go through every row and get a string with delimiters as a result? Hope you understand what I mean.
|
Use
pawn Код:
while(mysql_retrieve_row()) {
mysql_fetch_row_format(dest);
//other code
}
or
pawn Код:
for(new r=0; r < cache_num_rows(); ++r) {
new dest[1024];
for(new f=0; f < cache_num_fields(); f++) {
if(f != 0) {
strcat(destination, "|");
}
new row_val_tmp[256];
cache_get_row(r, f, row_val_tmp);
if(f == 0)
strins(dest, row_val_tmp, 0);
else
strcat(dest, row_val_tmp);
}
//here you now have your values with a | delimiter, like "1|TestName|32512|Password"
}
And also stop using R29 and switch to R31! :P
Posts: 43
Threads: 10
Joined: Feb 2012
Reputation:
0
Why is it good for a mySQL plugin to use cache?
Posts: 845
Threads: 3
Joined: Jun 2010
Quote:
Originally Posted by RedCrossER
latest version of what?
|
Of the MySQL plugin (R31).
Quote:
Originally Posted by Kar
I had a weird issue where mysql_affected_rows() returned -1 once.. How is this possible?
Also what would you say about transferring this project to GitHub. In all honesty its surpassed ****** project..
|
I also got that one day. I thought it was a bug somewhere, but I checked everything and found nothing. Then I changed the query a bit and it suddenly worked. I was sending such an INSERT-query
PHP код:
INSERT INTO test (`Field1`) VALUE ('321')
and then I replaced "VALUE" with "VALUES" and cache_affected_rows returned 1. Both queries are correct (they are both creating a new row), but only one is the real correct one.
I sent BlueG a PM some weeks ago where I asked him if he could move the project to GitHub, but didn't got an answer yet.
Posts: 213
Threads: 44
Joined: May 2010
Reputation:
0
if using mysql_tquery, will continue keeping the cache is like using mysql_function_query?
I jump from R15 to R31, and I'm not sure how to use the new features of cache
Posts: 2,938
Threads: 162
Joined: May 2010
Well mine was a update query, idk. Here see for yourself
pawn Код:
forward Check_For_Unbans();
public Check_For_Unbans()
{
mysql_function_query(McHandle, "UPDATE `"#BAN_TABLE_NAME"` SET `"#BAN_COLUMN_EXPIRE"` = -1 WHERE `"#BAN_COLUMN_EXPIRE"` < UNIX_TIMESTAMP() AND `"#BAN_COLUMN_EXPIRE"` != 0", true, "Thread_Check_For_Unbans", "i", -1); //expires = 0 // DATE_ADD("#BAN_COLUMN_TIME_BANNED", INTERVAL "#BAN_COLUMN_TIME" SECOND) <= NOW()
return 1;
}
THREAD:Check_For_Unbans(extraid)
{
new count = mysql_affected_rows();
if(count)
{
printf("[Server: Check_For_Unbans] - %d Banned Players Have Been Unbanned", count);
MessageToAdmins(_, "[Server: Check_For_Unbans] - %d Banned Players Have Been Unbanned", count);
}
return 1;
}
Alright. Maybe you should use IRC, can message you easier there too.
Posts: 845
Threads: 3
Joined: Jun 2010
PHP код:
UPDATE `"#BAN_TABLE_NAME"` SET `"#BAN_COLUMN_EXPIRE"` = '-1' WHERE `"#BAN_COLUMN_EXPIRE"` < UNIX_TIMESTAMP() AND `"#BAN_COLUMN_EXPIRE"` != '0'
Maybe this one will work? (have put the query values in ')
Yes, maybe I should use IRC. Some day.
Posts: 2,938
Threads: 162
Joined: May 2010
Integers doesn't require single quotes in MySQL, only strings do.
It's fine though.
That Some Day should be soon, lol
Posts: 845
Threads: 3
Joined: Jun 2010
It's not a bug. It just warns you that there is already a similar connection and then returns the connection id of the existing connection. You can simply ignore that.
Posts: 845
Threads: 3
Joined: Jun 2010
Are you using the correct libmysql.dll (if on Windows)? Is the MySQL server online?