problem with birthdays

I ran into a bit of an issue on my site over the past few weeks when I started allowing registrations without setting birthdate. My memberbase doesn't particularly care about birthdates or ages of other members, and nor do I want it to be required. But now I'm finding that the null value of 0000-00-00 in the database is causing an error when sitename.com/browse.php is accessed. Members see a blank white page, and I get the error quoted below in an email.

Is it possible to omit the code so browse.php doesn't error out? My thoughts are that this is coming from the table selection where you can click an age group to browse within.

Thanks in advance for any hints - if you post me a link to a paid extension for this I will smack you... :)

Database error in

Query:
SELECT COUNT(*) FROM `Profiles` WHERE `Status` = 'Active' 
AND
((YEAR(CURDATE())-YEAR(`DateOfBirth`)) - (RIGHT(CURDATE(),5)<RIGHT(`DateOfBirth`,5))) >= 13
AND
((YEAR(CURDATE())-YEAR(`DateOfBirth`)) - (RIGHT(CURDATE(),5)<RIGHT(`DateOfBirth`,5))) <= 15

Mysql error: Unknown column 'DateOfBirth' in 'where clause'

Found error in the file 'html/inc/classes/BxDolBrowse.php' at line 148.
Called 'db_value' function with erroneous argument #0.


Debug backtrace:

....

Skype: shawn.nelson
Quote · 9 Aug 2010

Hello!

Better to restore DateOfBirth field in `Profiles` table via execution this query:

ALTER TABLE `Profiles` ADD `DateOfBirth` date NOT NULL;

It is simplest way of fixing.

Regard

Quote · 10 Aug 2010

Thanks LeonidS,

I gave it a shot, however it appears it did not solve the issue. Upon checking the database in phpmyadmin, the field is set as 'not null', and everyone that had registered without a birthdate is showing 0000-00-00.

I cleared cache and everything with no luck. This issue also appears to be much more severe than originally anticipated, I can no longer administrate members within the administration backend.. all member related pages are showing up blank!

Do you happen to have any other suggestions?

Skype: shawn.nelson
Quote · 10 Aug 2010

Anyone able to provide me any insight with this one? It is becoming a bigger issue than what I originally anticipated. Not being able to browse members in the admin panel is a HUGE issue :(.

I modified my site settings to allow ages 0-100, and went through the last 30 or so members that joined since making the modification to the join page and gave them a birthday of Aug 6 2010 just to see what would happen, I did not make any progress with those changes. Should I try setting them out beyond a year old?

Skype: shawn.nelson
Quote · 10 Aug 2010
Hello shnelson! Well, first of all - if u want to "remove" some fields better to hide them. About ur problem - well, try to add default age for this field. It will be (if u already executed my yesterday command): ALTER TABLE `Profiles` CHANGE `DateOfBirth` `DateOfBirth` date NOT NULL default '1990-01-01'; Regards
Quote · 11 Aug 2010
LeonidS, Thank you so much! I re-ran the query from your first post when I got home, and it worked this time around. I'm able to browse and administer members just like before.
Skype: shawn.nelson
Quote · 12 Aug 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.