MYSQL - Run time error 19
#1

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
Reply
#2

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);
Reply
#3

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)