Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

MySQL R40 - Insert statement not working

$
0
0
I am trying to insert data into the table and these statements work as expected:

Code:

mysql_format(g_SQL, query, sizeof(query), "INSERT INTO `admins` (`pId`, `pName`, `pAdmin`, `aTime`, `aStatus`) VALUES ('%d', '%e', '%d', '%d', 1)", PlayerInfo[id][pId], pName2, level, timestamp);
mysql_tquery(g_SQL, query, "", "");

But when I try to execute this:

Code:

mysql_format(g_SQL, query2, sizeof(query2), "INSERT INTO `bans` (`pId`, `pName`, `bIp`, `bReason`, `bTime`, `pBanned`, `bExpiration`) VALUES ('%d', '%e', '%e', '%e', '%d', 1, 8000)", PlayerInfo[id][pId], pName2, pIp, reason, timestamp);
mysql_tquery(g_SQL, query2, "", "");

Nothing works. If I execute the query using only first columns, then it works perfectly fine. If I execute using only last two, it still works good, but when I execute them together, no data is inserted.

I have checked the database. There is no problem. I am matched the data types.

I am stuck into this weird problem since last three days. Please help.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>