03.02.2010, 16:23
Hi again! I've got another request.
As we know, the plugin doesn't require mysql_fetch_row() before fetching separate fields. It's obviously a proper behaviour, but you do a little thing, which makes the plugin less compatible and may cause problems for people trying to switch to it.
What I mean is my[h].row = NULL in n_mysql_fetch_row(). As you know, there are people using while(mysql_fetch_row(..)) to fetch their data, but even though they use this function, they also use fetching single fields, so their code looks like:
This code, however, will not work properly and it will retrieve only half of actual rows, because mysql_fetch_row() fetches one row and "frees" it, and then the first mysql_fetch_field() fetches another row.
To fix that, you can simply remove my[h].row = NULL from n_mysql_fetch_row(). You do it anyway in mysql_free_result(), so it definitely won't cause any problems.
And if there's something, which can make users want to switch, then why not?
Actually, you could also provide a native which they could put in a while() instead of b_mysql_fetch_row(), which would simply call the mysql_fetch_row() in order to fill my[h].row without returning any PAWN string. It would make users to be able to switch really easily, it would be a mix of efficiency and compatibility.
As we know, the plugin doesn't require mysql_fetch_row() before fetching separate fields. It's obviously a proper behaviour, but you do a little thing, which makes the plugin less compatible and may cause problems for people trying to switch to it.
What I mean is my[h].row = NULL in n_mysql_fetch_row(). As you know, there are people using while(mysql_fetch_row(..)) to fetch their data, but even though they use this function, they also use fetching single fields, so their code looks like:
Code:
while(mysql_fetch_row(..)) { mysql_fetch_field("blah",dest); mysql_fetch_field("blah",dest); mysql_fetch_field("blah",dest); }
To fix that, you can simply remove my[h].row = NULL from n_mysql_fetch_row(). You do it anyway in mysql_free_result(), so it definitely won't cause any problems.
And if there's something, which can make users want to switch, then why not?
Actually, you could also provide a native which they could put in a while() instead of b_mysql_fetch_row(), which would simply call the mysql_fetch_row() in order to fill my[h].row without returning any PAWN string. It would make users to be able to switch really easily, it would be a mix of efficiency and compatibility.