Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7420353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:13:24+00:00 2026-05-29T08:13:24+00:00

All, I have the following code: $fetch = mysql_query(SELECT * FROM calendar_events where event_status=’booked’

  • 0

All,
I have the following code:

$fetch = mysql_query("SELECT * FROM calendar_events where event_status='booked' and event_type='wedding' GROUP BY start"); 
while ($row = mysql_fetch_array($fetch, MYSQL_ASSOC)) {
    $row_array['id'] = $row['id'];
    $row_array['title'] = $row['title'];
    $row_array['start'] = $row['start'];
    $row_array['end'] = $row['end'];
    array_push($return_arr,$row_array);
}
echo json_encode($return_arr);

I’m using the fullcalendar and trying to determine how many events have the same start date. So for example if I had the following dates:

02/06/2012
02/06/2012
03/01/2012
04/05/2012

On dates that have entries in my database I’d like to basically see how many events are on that date and basically say how many spots are left. So for any given date I can have two scheduled events so for 02/06/2012 I’d like it to return “Booked” and for 03/01/2012 I’d like “1 spot left” and etc.

How can I go about doing something like this?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T08:13:25+00:00Added an answer on May 29, 2026 at 8:13 am
    SELECT 
    start, count(*) as used, 2-count(*) as free
    FROM calendar_events 
    WHERE event_status='booked' 
      and event_type='wedding'
    GROUP BY start
    

    or as by your comment:

    SELECT 
    date(start) as eventdate, count(*) as used, 2-count(*) as free
    FROM calendar_events 
    WHERE event_status='booked' 
      and event_type='wedding'
    GROUP BY date(start)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All, I have the following code: $qry = Select * from vendor_options order by
Hello and good day to all. I have the following code to retrieve from
I have the following code $result = $handle->select()->from('store_products_id', array('count'=>'COUNT(store_products_id.product_id)')) ->where('store_products_id.store_id=?', $this->store_id) ->columns($selectColumns) ->join('product_quickinfo', 'store_products_id.product_id
I have the following code to zip all the files and then save it
I have the following code: // Obtain the string names of all the elements
I have the following code to assign a value to all the elements of
i have the following code def get(self): date = datetime.date.today() loc_query = Location.all() last_cursor
I have following statement for query articles from some sections Article.all(:joins => :sections, :conditions
The following code brings up all the fixtures from the database. while ($row =
I have the following Java code to fetch the entire contents of an HTML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.