23.08.2011, 15:29
Is the a_mysql.inc code supposed too look like this?
Edit: I changed the a_mysql.inc to the code above and now I get this when trying to compile:
Second Edit: I tryed to remove the ... from the a_mysql.inc, now it compiled. When I start the server it says: Script[gamemodes/grp.amx]: Run time error 6: "Invalid Instruction"
What now?
Code:
//this example demonstrates how to use more connections new SQLPtr[2]; //global var ... Function() { SQLPtr[0] = mysql_connect(...); SQLPtr[1] = mysql_connect(...); mysql_query("SELECT a FROM table WHERE foo = 'bar'",(-1),(-1),SQLPtr[0]); //select query in the first DB mysql_query("UPDATE b SET bar = 'foo'",(-1),(-1),SQLPtr[1]); //update query in the second DB mysql_close(SQLPtr[1]); //close the 2nd DB connection, the other connection still exists Supported formats: (precisions such as %2.f/%10.s are not supported yet) - %e (escapes data directly without the need to call mysql_escape_string() before) - %s (string) - %d / %i (integer) - %f (float) new szDestination[100]; mysql_format(connectionHandle, szDestination, "SELECT * FROM `%s` WHERE `bar` = '%e' AND `foobar` = '%f' LIMIT %d", "foobar", "escape'me\"please", 1.2345, 1337); // the variable 'szDestination' contains now the formatted query (including the escaped string) mysql_query(szDestination);
Code:
C:\Users\Thomas\Desktop\asdf\pawno\include\a_mysql.inc(3) : error 010: invalid function or declaration C:\Users\Thomas\Desktop\asdf\gamemodes\qrp.pwn(12) : warning 203: symbol is never used: "Function" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
What now?