[Include] RUDO Inc v1.1 Useful Funcitons for MySQL
#1

Foreword
My first include.I am next time to mixed functions adding.Now of adding to include for mysql functions.Good luck.

Use
Top of the script.
pawn Код:
#include <rudo.inc>
Functions
  • sql_Int(column[], table[], condition[], conditionif[]) - Reading Integer
Example:
pawn Код:
new name[24];
GetPlayerName(playerid, name, sizeof(name));
sql_Int("money", "chars", "charname", name);
  • sql_Float(column[], table[], condition[], conditionif[]) - Reading Float
Example:
pawn Код:
new name[24];
GetPlayerName(playerid, name, sizeof(name));
sql_Float("angle", "chars", "charname", name);
  • sql_Text(column[], table[], condition[], conditionif[]) Reading Text
pawn Код:
new name[24];
GetPlayerName(playerid, name, sizeof(name));
sql_Text("charname", "chars", "charname", name);
  • sql_IntSet(table[], column[], setcolumn, condition[], conditionif[]) - Update Integer
Example:
pawn Код:
new name[24];
GetPlayerName(playerid, name, sizeof(name));
sql_IntSet("chars", "money", "300", "charname", name);
  • sql_FloatSet(table[], column[], Float : setcolumn, condtion[], conditionif[]) - Update Float
pawn Код:
new name[24];
GetPlayerName(playerid, name, sizeof(name));
sql_FloatSet("chars", "angle", "2000", "charname", name);
  • sql_Set(table[], column[], setcolumn[], condition[], conditionif[]) - Update Text
pawn Код:
new name[24];
GetPlayerName(playerid, name, sizeof(name));
sql_Set("chars", "pass", "pass123456", "charname", name:);
Succession and Bug


Download
Download Rudo Inc v1.1
Reply
#2

Not easier for me.
Anyway you should change:
pawn Код:
WHERE %s = '%s'
to
pawn Код:
WHERE `%s` = '%s'
And
pawn Код:
sql_Int("money", "chars", charname, name);
should be
pawn Код:
sql_Int("money", "chars", "charname", name);
Reply
#3

Thanks. I had a problem, but I am change.
Reply
#4

Thanks Rudo2
Reply
#5

Quote:
Originally Posted by wups
Посмотреть сообщение
Not easier for me.
Anyway you should change:
pawn Код:
WHERE %s = '%s'
to
pawn Код:
WHERE `%s` = '%s'
You can omit those symbols if you want, they are not needed. Only Apostrophe's around strings are needed. (not table/column names)
Your syntax is valid but not necessary.

pawn Код:
"SELECT  userid, password, email FROM userdata WHERE username='%s'" //valid
@OP Suggestion:
Have a look at the "BUD" include by slice, you could make a "multiget" or "multiset" type function which would be better than running one query per value.
Reply
#6

can you add paste bin link it might be useful for someone.
Reply
#7

It's looking nice but a pastebin link would be better.
Reply
#8

Yay, new funcitons!
Reply
#9

I am not released Rudo Include
Reply
#10

Nice keep the good work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)