SA-MP Forums Archive
MYSQL - Run time error 19 - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MYSQL - Run time error 19 (/showthread.php?tid=331406)



MYSQL - Run time error 19 - red13 - 04.04.2012

Hi,
I have already posted this in at the german forum, but I haven't get an answer, yet.
So I hope you guys can help me.

I just tried to install the MySQL-Plugin for my SA-MP Server. I wrote some functions, like reading an integer in the database.
But if I try to include them in a empty test-script, I'll become an run time error.

The plugin was loaded succesfully.
This is the function causeing the error:

PHP код:
public DB_READ_INT(table[],ID,inhalt[]){
    new 
query[200];
    
format(query,200,"SELECT %s FROM %s WHERE ID = %d",inhalt,table,ID);
    
mysql_query(query); // <== If I delete this and the following lines, it will work.
    
mysql_store_result();
    if(
mysql_num_rows() != 0){
        new 
data;
        
data mysql_fetch_int();
        
mysql_free_result();
        return 
data;
    }
    else{
        
mysql_free_result();
        return -
1;
    } 
I uses the plugin by G-StyleZzZ.

Greetings red13


Re: MYSQL - Run time error 19 - TzAkS. - 04.04.2012

Try
pawn Код:
format(query,200,"SELECT `%s` FROM `%s` WHERE ID = `%d`",inhalt,table,ID);
Or
pawn Код:
format(query,200,"SELECT `inhalt` FROM `table` WHERE ID = `%d`",ID);



Re: MYSQL - Run time error 19 - aRoach - 04.04.2012

Maybe:
pawn Код:
format(query, 200, "SELECT `%s` FROM `%s` WHERE `ID` = %d", inhalt, table, ID);



AW: MYSQL - Run time error 19 - red13 - 04.04.2012

Oh, I controlled the installation of the plugin, because just adding the function "mysql_query" forces the server to crash.
I have not executed it.
And I noticed, that the plugin "mysql.dll" and the include "a_mysql.inc" were different versions.

Now it works fine.
Thank you for your help. Finally it was my fault as usual.

red13