Jump to content

Recommended Posts

Posted

I have a website that is about live local music. fingerlakeslive

 

Right now I am using phpbb with the mycalendar addon to take care of users inputting upcoming shows. What I am trying to do is make an index page see here

that pulls these events out and displays them on a side bar. I have made some progress, but have one question about my select query.

 

current select query

>$result = @mysql_query('SELECT * FROM phpbb_mycalendar,phpbb_topics WHERE phpbb_mycalendar.topic_id=phpbb_topics.topic_id ORDER BY cal_date LIMIT 10');

 

This works and displays what you see on my index page. But you will notice that it is displaying events that have already happened. How do I select only upcoming dates?

 

do I use CURDATE() somehow in my query? I am somewhat new to php/mysql so take it easy on me. lol

thanks

Posted
Sorry, I don´t know the answer to this but...

 

Welcome to the forum. :(

 

 

lol well atleast your honest! and thanks for the welcoming! I have been with TCH for quite some time now, and I can't believe I have never used these forums.

Posted

evhwanabe, try using this query:

 

$result = @mysql_query("SELECT * FROM phpbb_mycalendar,phpbb_topics WHERE phpbb_mycalendar.topic_id=phpbb_topics.topic_id AND phpbb_mycalendar.date>='".time()."' ORDER BY cal_date LIMIT 10");

Posted
evhwanabe, try using this query:

 

$result = @mysql_query("SELECT * FROM phpbb_mycalendar,phpbb_topics WHERE phpbb_mycalendar.topic_id=phpbb_topics.topic_id AND phpbb_mycalendar.date>='".time()."' ORDER BY cal_date LIMIT 10");

 

 

hmmmm still no luck.

the date field (timestamp) I am trying to go by is stored in the phpbb_mycalendar table in row cal_date

 

I changed your above code "phpbb_mycalendar.date" to "phpbb_mycalendar.cal_date" and still no luck.

 

thanks for the reply

Posted

Got it!

 

>$result = @mysql_query("SELECT * FROM phpbb_mycalendar,phpbb_topics WHERE phpbb_mycalendar.topic_id=phpbb_topics.topic_id AND phpbb_mycalendar.cal_date>=CURDATE() ORDER BY cal_date LIMIT 10");

 

Thanks guys!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...