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 7560093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:48:33+00:00 2026-05-30T12:48:33+00:00

Here is my search query, which is putting out an argument error. What do

  • 0

Here is my search query, which is putting out an argument error.
What do I need to do to correct it. Basically I need to put both of these tables together and pull out the next 5 events within the two tables by the start date. You will also notice that the last field in each table is different from one another.

$CEsql = mysql_query("
  SELECT id, title, start, end, allDay
  FROM calendar 
  WHERE mem_id='$logOptions_id' 
    AND start >= DATE_SUB( CURDATE( ) ,INTERVAL 0 MONTH ) 
  
  UNION ALL 

  SELECT id, title, start, end, allDay
  FROM team_calendar 
  WHERE team_id IN ($team_array) 
    AND start >= DATE_SUB( CURDATE( ) ,INTERVAL 0 MONTH ) 
  ORDER BY start ASC LIMIT 5");

I am using MYSQL 5.0 and PHP.

Update

mysql_error displays:

1267: Illegal mix of collations for operation ‘UNION’

  • 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-30T12:48:34+00:00Added an answer on May 30, 2026 at 12:48 pm

    Run SHOW CREATE TABLE statements for both tables. Find differences between two tables, check charsets and collations as Leap Bun suggested. Then you may change field charset/collation, or just try to use COLLATE clause in your SELECT query. Something like this –

    SELECT id, title, start, end, allDay
      FROM calendar 
      WHERE mem_id='$logOptions_id' 
        AND start >= DATE_SUB( CURDATE( ) ,INTERVAL 0 MONTH ) 
    
      UNION ALL 
    
      SELECT id, 
        title COLLATE collation_name AS title, -- write your collation here
        start, end, allDay
      FROM team_calendar 
      WHERE team_id IN (1,2) 
        AND start >= DATE_SUB( CURDATE( ) ,INTERVAL 0 MONTH ) 
      ORDER BY start ASC LIMIT 5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I have a search query, which works fine if I'm using it with
Here is the db schema Tables- I want to write a query to search
I have a course table which I need to search based on keywords typed
I've an asp.net web application which uses Lucene API for search. Here is the
I would like to convert a image query, found here http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=xxxxxxx&query=cars In vb2005.net to
Had a good search here but can't see anything that gets my mind in
So my goal here is to have a single search field in an application
I infer from Google search results that strings.h (from here ) is for UNIX
Here is a generic question. I'm not in search of the best answer, I'd
I found this on net in google search and see article here: http://www.thatcssguy.com/limit-your-divs/ See

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.