SA-MP Forums Archive
#define with function mysql - 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: #define with function mysql (/showthread.php?tid=541281)



#define with function mysql - Mhaux - 10.10.2014

Hi,

I wanna use #define for add automatically a printf about my request when I use mysql_pquery, can you help me please?

Thanks you


Re: #define with function mysql - MrCallum - 10.10.2014

#define GET_INT(%1,%2) mysql_fetch_field_row(tmp, %2);%1 = strval(tmp)
#define GET_STR(%1,%2) mysql_fetch_field_row(%1, %2)
#define GET_FLOAT(%1,%2) mysql_fetch_field_row(tmp, %2);%1 = floatstr(tmp)

try that


Re: #define with function mysql - paulommu - 10.10.2014

Try this:

pawn Code:
#define _mysql_pquery(%1,%2,%3,%4,%5) do{mysql_pquery(%1,%2,%3,%4,%5);print(%2);}while(-1)
It will execute the query, then print it on the console.


Re: #define with function mysql - Mhaux - 11.10.2014

Don't work