Pawno errors..
#7

Is the a_mysql.inc code supposed too look like this?

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);
Edit: I changed the a_mysql.inc to the code above and now I get this when trying to compile:

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.
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?
Reply


Messages In This Thread
Pawno errors.. - by reckst4r - 23.08.2011, 13:37
Re: Pawno errors.. - by Gray - 23.08.2011, 13:42
Re: Pawno errors.. - by playbox12 - 23.08.2011, 13:48
Re: Pawno errors.. - by reckst4r - 23.08.2011, 13:56
Re: Pawno errors.. - by Gray - 23.08.2011, 13:56
Re: Pawno errors.. - by reckst4r - 23.08.2011, 14:20
Re: Pawno errors.. - by reckst4r - 23.08.2011, 15:29
Re: Pawno errors.. - by reckst4r - 23.08.2011, 16:47
Re: Pawno errors.. - by =WoR=Varth - 24.08.2011, 18:21
Re: Pawno errors.. - by reckst4r - 24.08.2011, 18:34

Forum Jump:


Users browsing this thread: 4 Guest(s)