Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Can you use a php variable to filter a recordset?

Explorer ,
Apr 02, 2007 Apr 02, 2007
I've got a table of 'events', which have a description and more importantly for this a month ID number. (1-12 for the months of the year, when the event takes place) .

I've used php's date function on a page to fund out numerically what month it is now $thismonth = date("n");

i want to filter my recordset by only bringing up events that take place during the current month so where event_month = $thismonth

IS this possible? It seems like it should be easy to do but I can't get it to work.

Thanks in advance

Dave
TOPICS
Server side applications
333
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 02, 2007 Apr 02, 2007
jnkjnkjnkjnkjn wrote:
> i want to filter my recordset by only bringing up events that take place
> during the current month so where event_month = $thismonth
>
> IS this possible? It seems like it should be easy to do but I can't get it to
> work.

Yes, it's very easy, but you need to do a little hand-coding. In the
Advanced recordset dialog box set the end of the SQL query to WHERE
event_month = 1. When you have saved the recordset, change the SQL to
WHERE event_month = $thismonth.

--
...
Translate
LEGEND ,
Apr 02, 2007 Apr 02, 2007
jnkjnkjnkjnkjn wrote:
> i want to filter my recordset by only bringing up events that take place
> during the current month so where event_month = $thismonth
>
> IS this possible? It seems like it should be easy to do but I can't get it to
> work.

Yes, it's very easy, but you need to do a little hand-coding. In the
Advanced recordset dialog box set the end of the SQL query to WHERE
event_month = 1. When you have saved the recordset, change the SQL to
WHERE event_month = $thismonth.

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 03, 2007 Apr 03, 2007
LATEST
brilliant, thanks
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines