Raised This Month: $ Target: $400
 0% 

Solved Problems with mysql table column


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
l00ka
Junior Member
Join Date: Sep 2012
Old 07-08-2020 , 12:58   Problems with mysql table column
Reply With Quote #1

Hello,

i got a small issue with a plugin.
The plugin works fine but it throws the following error all the time in the server console:

Quote:
07/08/2020 - 16:29:47: [deathrun_stats.amxx] SQL error: Incorrect datetime value: '' for column 'recorddate' at row 1
when I look into the specific table there is indeed in some rows a NULL value in the 'recorddate' column.

And when I look into the sql statements I see the following insert statment that made me suspicious:
HTML Code:
formatex(gszQuery, charsmax(gszQuery), "INSERT INTO `results` VALUES (%d, %d, 0, 1, 0, 0, NULL)", giPid[id], gMid);
as you might see the last parameter in the insert is the column with the datetime value NULL.

My question is, how do I get the current time in the datetime format and insert it here instead of NULL.

Hope someone can help me out. Thx.

UPDATE:
TLTR; I compiled with the old Init.inl file.
So the solution is to update the following line in the Init.inl insert statement and recompile with the updated Init.inl file.
Code:
formatex(gszQuery, charsmax(gszQuery), "INSERT INTO `results` VALUES (%d, %d, 0, 1, 0, 0, now())", giPid[id], gMid);
Attached Thumbnails
Click image for larger version

Name:	db.PNG
Views:	73
Size:	28.2 KB
ID:	182447  
Attached Files
File Type: txt db sql.txt (7.3 KB, 59 views)

Last edited by l00ka; 07-17-2020 at 16:25. Reason: added attachment
l00ka is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode