close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


search date from age number

Thread began 6/07/2010 9:46 pm by Miguel | Last modified 6/08/2010 3:12 pm by Eric Mittman | 678 views | 1 replies |


search date from age number

Hello again, i been going in circles to find a solution to do a search let me explain i got a table of users

name varchar 150
email varchar 150
birthdate date
country varchar 150

Im trying to do a search by age with filters like user from canada that are 20 years old how can i acomplish this with dataassist i have the birthdate field as date and have a function to show on the list how old is the person
displaying the age based on the birth date but how do i do the oposit typing in an age 20 or 30 years old and it displays the users on that range using the data assist search wizard?

function cumple ($cumple){
    list($year,$month,$day) = explode("-",$cumple);
    $year_diff  = date("Y") - $year;
    $month_diff = date("m") - $month;
    $day_diff   = date("d") - $day;
    if ($day_diff < 0 || $month_diff < 0)
    return $year_diff;
Sign in to reply to this post

Eric Mittman

There are probably a few ways that you could do this. One way that I can think of is to take the values that are entered for the age range and convert the age range to a date range with some php code.

You can then do a search in your db based on the dates that you have. To do this with a DataAssist search you would want to make sure that you use the GET method so that you can perform your age to date conversion then pass the values in a query string to your results page. Then the DataAssist search on this page can use the date values that you passed in the query.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...