URL Date Searching

5 posts by 2 authors in: Forums > CMS Builder
Last Post: September 9, 2009   (RSS)

By Kenny - September 8, 2009

For some reason,

<a href="schedules/local.php?date=<?php echo date("D, M d, Y", strtotime($record['date'])) ?>"><?php echo date("D, M d, Y", strtotime($record['date'])) ?></a>

is not producing any results.

I need for a user to click on a date and bring up all the entries with that date.

What am I missing?


Kenny

Re: [sagentic] URL Date Searching

By Chris - September 8, 2009

Hi Kenny,

Can you post the PHP source code for your local.php page please?
All the best,
Chris

Re: [sagentic] URL Date Searching

By Chris - September 8, 2009

Hi Kenny,

You'll need to use the same format for your date that MySQL uses.

<a href="?date=<?php echo date("Y-m-d", strtotime($record['date'])) ?>">

If your date fields are also keeping track of time, you'll need to search with the _prefix operator:


<a href="?date_prefix=<?php echo date("Y-m-d", strtotime($record['date'])) ?>">

I hope this helps! :)
All the best,
Chris

Re: [chris] URL Date Searching

By Kenny - September 9, 2009

That worked great Chris - thanks!