[MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Hello RZ,
I am using UberCMS 2.0.1 with Phoenix Emulator. I have a problem where if a new user sends a f/r to an older user I need to run this SQL query in the DB
PHP Code:
UPDATE `users` SET `last_online` = UNIX_TIMESTAMP()
Other wise the user who received the friend request will not be able to get back on. I have google searched and tried the fix posted by Subz (I think that is his name) But I have to run the SQL Query stated above or it just messes up again. All help welcome as long as it suits subject. (Meaning no posting saying "You must have done it wrong, tv" or "I user revcms as its better. I dont use ubercms, but good luck")
PLEASE NOTE TO MOD's Before you delete the thread (If you need too) Message me what is wrong with it and I will fix it. Thank you.
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Strange, but what happens if you just set a default value?
Code:
ALTER TABLE `users` CHANGE `last_online` `last_online` INT( 15 ) NOT NULL DEFAULT '0'
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Quote:
Originally Posted by
flx5
Strange, but what happens if you just set a default value?
Code:
ALTER TABLE `users` CHANGE `last_online` `last_online` INT( 15 ) NOT NULL DEFAULT '0'
That made it so users couldn't register anymore. Thanks anyways.
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Change the last_online column to double and restart your emulator.
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Quote:
Originally Posted by
BaasHotel
Change the last_online column to double and restart your emulator.
Oh yeah forgot about that, some emulators make the mistake to enter doubles instead of integers...
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Quote:
Originally Posted by
flx5
Oh yeah forgot about that, some emulators make the mistake to enter doubles instead of integers...
Nope still get the same error
PHP Code:
UberCMS has encountered an error
Incorrect integer value: '' for column 'last_online' at row 1
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
hm, seems like very incorrect code...
Are you running MySQL within strict mode?
Because many Devs around here just ignore some standards which leads to errors when running the MySQL Server within strict mode...
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
No I have strict mode turned off.
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Sorry for the late awnser but I've been on vacation...
Now I'm really confused...
Can you tell me the line and the SQL Query which produces the error above?
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Quote:
Originally Posted by
flx5
Sorry for the late awnser but I've been on vacation...
Now I'm really confused...
Can you tell me the line and the SQL Query which produces the error above?
If I run
Code:
ALTER TABLE `users` CHANGE `last_online` `last_online` INT( 15 ) NOT NULL DEFAULT '0'
Then I get
PHP Code:
UberCMS has encountered an error
Incorrect integer value: '' for column 'last_online' at row 1
On the register page. I'm not sure on where the code is coming from as I'm still new to the way Uber works.
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Huh, now I've got an idea...
Open /inc/class.users.php and go to the function Add.
There you'll have to replace this line:
PHP Code:
dbquery("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,credits,activity_points,last_online,account_created) VALUES ('" . $username . "','" . $passwordHash . "','" . $email . "','','" . $rank . "','" . $figure . "','" . $sex . "','','500','1000','','" . date('d-M-Y') . "')");
with
PHP Code:
dbquery("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,credits,activity_points,last_online,account_created) VALUES ('" . $username . "','" . $passwordHash . "','" . $email . "','','" . $rank . "','" . $figure . "','" . $sex . "','','500','1000',".time().",'" . date('d-M-Y') . "')");
EDIT:
Please do NOT forget to make a BACKUP
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Quote:
Originally Posted by
flx5
Huh, now I've got an idea...
Open /inc/class.users.php and go to the function Add.
There you'll have to replace this line:
PHP Code:
dbquery("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,credits,activity_points,last_online,account_created) VALUES ('" . $username . "','" . $passwordHash . "','" . $email . "','','" . $rank . "','" . $figure . "','" . $sex . "','','500','1000','','" . date('d-M-Y') . "')");
with
PHP Code:
dbquery("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,credits,activity_points,last_online,account_created) VALUES ('" . $username . "','" . $passwordHash . "','" . $email . "','','" . $rank . "','" . $figure . "','" . $sex . "','','500','1000',".time().",'" . date('d-M-Y') . "')");
EDIT:
Please do NOT forget to make a BACKUP
Code:
UberCMS has encountered an error
Field 'ip_reg' doesn't have a default value
Is what I get after changing over the code.
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Those errors really remember me of strict mode...
Is your original line exactly the same as the one I've posted above?
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Quote:
Originally Posted by
flx5
Those errors really remember me of strict mode...
Is your original line exactly the same as the one I've posted above?
Yep. I double checked and made sure MySQL Strict mode is set to off.
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
hm, then just change the line to
PHP Code:
dbquery("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,credits,activity_points,last_online,account_created,ip_reg) VALUES ('" . $username . "','" . $passwordHash . "','" . $email . "','','" . $rank . "','" . $figure . "','" . $sex . "','','500','1000',".time().",'" . date('d-M-Y') . "', '".USER_IP."')");
Re: [MYSQL][PHP][UBERCMS] UberCMS 2 last_online error read for more information.
Quote:
Originally Posted by
FatalLulz
Code:
UberCMS has encountered an error
Field 'ip_reg' doesn't have a default value
Is what I get after changing over the code.
Ey this is good!
Make the fix from flx5, and then import my Fix!
SET@@global.sql_mode ='';
Now it works!