MyBB Community Forums

Full Version: php Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I got this php error when I tried to visit someone's profile.
The following warnings occurred:
Warning [2] mktime() expects parameter 4 to be long, string given - Line: 1454 - File: member.php PHP 5.2.12 (Linux)
File 	Line 	Function
[PHP] 	  	errorHandler->error
/member.php 	1454 	mktime

Thanks!
I had this problem before. Open the member.php file and go to line 1454 to find the field it is referencing. Then open phpMyAdmin and change the field type. I tried opening member.php here at work to find the field for you but it's taking forever to open without Notepad++. Sad
Don't change the field type, you don't need to change the database structure to fix a PHP error, the data on this line is exploded values from one field. This is caused by an incomplete birthday, get this user to edit and save a full birthday in their profile and it should be fine. Have you recently merged from another forum software??

$membday = explode("-", $memprofile['birthday']);

Line 1454:

$membday = mktime(0, 0, 0, $membday[1], $membday[0], 0);

Parameter 4 is $membday[1], the 2nd value of the exploded birthday, so if this isn't valid, it won't work properly.
I just converted one of my forums from phpBB to MyBB.

Is there a SQL code that adds all members have a birthday of any date?
Yeah this tends to happen with merges. Can you see what the birthday currently is for this user??
Ouch... it seems that the host has some problem currently. Sad I can't access my site.
OK, run this:

UPDATE `mybb_users` SET `birthday` = '' WHERE `birthday` = '-';
I don't quite understand. This is the error I get:

Warning [2] mktime() expects parameter 4 to be long, string given - Line: 1467 - File: member.php PHP 5.2.13 (Linux)

/member.php   1467   mktime

What do I do to solve this? I tried reuploading a fresh members.php file but the issue persists. Do I change the edits you posted above in the members.php file from:

$membday = explode("-", $memprofile['birthday']); 

To:

$membday = mktime(0, 0, 0, $membday[1], $membday[0], 0); 

?
(2010-03-28, 11:57 AM)MattRogowski Wrote: [ -> ]OK, run this:

UPDATE `mybb_users` SET `birthday` = '' WHERE `birthday` = '-';

Run that MySQL query.
(2010-07-19, 01:25 PM)KuJoe Wrote: [ -> ]
(2010-03-28, 11:57 AM)MattRogowski Wrote: [ -> ]OK, run this:

UPDATE `mybb_users` SET `birthday` = '' WHERE `birthday` = '-';

Run that MySQL query.

Ahh great thanks that worked Smile