Another SQL Problem...
#1

Well guys, I need some help about this:
pawn Код:
new Query[ 129 ];
format( Query, 129, "INSERT INTO `Banlist` VALUES('%s','%s','%s','%s','%s')", GetPlayerIpEx( u_P ), pName( u_P ), s_R, pName( playerid ), Date( ) );
db_query( g_dbKeptAlive, Query );
It doesn't put the information in the DB...

-----------

I've tried this too:
pawn Код:
new Query[ 129 ];
format( Query, 129, "INSERT INTO Banlist(`IP`, `Name`, `Reason`, `Admin`, `BanDate`) VALUES('%s', '%s', '%s', '%s', '%s')", GetPlayerIpEx( u_P ), pName( u_P ), s_R, pName( playerid ), Date( ) );
db_query( g_dbKeptAlive, Query );
-----------

So, please.. Help me!
Reply
#2

In the debug output, does the query cut out?
Reply
#3

The same thing, when I try to do It in the SQL Manager with some random Values it Works...
Reply
#4

pawn Код:
new Query[ 129 ];
format( Query, 129, "INSERT INTO `Banlist` (`IP`, `Name`, `Reason`, `Admin`, `BanDate`) VALUES ('%s', '%s', '%s', '%s', '%s')", GetPlayerIpEx( u_P ), pName( u_P ), s_R, pName( playerid ), Date( ) );
db_query( g_dbKeptAlive, Query );
Column and Table name inside `` and values inside ' '. When using INSERT INTO you must define Columns in which to store values before giving values.
Reply
#5

The same thing, I've used this first but... no result..
Reply
#6

probably is the dialogid ... other function works on it?
Reply
#7

The dialog works fine lol...
And yes, the other functions works fine...
Reply
#8

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
pawn Код:
new Query[ 129 ];
format( Query, 129, "INSERT INTO `Banlist` (`IP`, `Name`, `Reason`, `Admin`, `BanDate`) VALUES ('%s', '%s', '%s', '%s', '%s')", GetPlayerIpEx( u_P ), pName( u_P ), s_R, pName( playerid ), Date( ) );
db_query( g_dbKeptAlive, Query );
Column and Table name inside `` and values inside ' '. When using INSERT INTO you must define Columns in which to store values before giving values.
That doesn't make any difference,
OP, does the query cut out on debug output?
Reply
#9

Oh, i got it xD

Try to increase the new Query ... in:
Код:
new Query[ 256 ];
Try now ^^, shut work now
Reply
#10

Quote:
Originally Posted by blank.
Посмотреть сообщение
That doesn't make any difference,
OP, does the query cut out on debug output?
Trust me that it does since 90% of time MySQL (or SQLLite) return Error in SQL Synatx.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)