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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:38:33+00:00 2026-05-28T19:38:33+00:00

Goal: Get values which are unique in $resultSecond So I have two objects. $result

  • 0

Goal: Get values which are unique in $resultSecond

So I have two objects.

$result and $resultSecond

I want to get values which are unique to $resultSecond and are NOT in the $result.

I tried to use array_diff().
It did not work as they are objects. I think.

Below is the code by which I am getting the data.

$result = db_query("
SELECT entity_id FROM field_data_field_date
WHERE bundle='postit' AND field_date_value > ".$customvishaltime." ");

$resultSecond = db_query("
SELECT entity_id FROM field_data_field_days
WHERE bundle='postit' AND field_days_value > ".$customvishaltime." ");

As per drupal the return of db_query is a prepared statement object. I have no clue what this means.

Reference:

For db_query
http://api.drupal.org/api/drupal/includes–database–database.inc/function/db_query/7

  • Have made changes as requested.
  • 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-28T19:38:34+00:00Added an answer on May 28, 2026 at 7:38 pm

    You are better off doing this as a left join query:

    $result = db_query("SELECT q2.entity_id 
                        FROM (
                               SELECT entity_id FROM field_data_field_days
                               WHERE bundle='postit' AND field_days_value > %f
                              ) AS q2 LEFT JOIN (
    
                               SELECT entity_id FROM field_data_field_date
                               WHERE bundle='postit' AND field_date_value > %f
    
                          ) AS q1 ON q2.entity_id = q1.entity_id
    
                        WHERE q1.entity_id IS NULL", $customvishaltime, $customvishaltime);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my goal is to get lots of rows from a translation table. I use
goal: I have the string 1234432144 I want to only replace the first 2
I want to make two MySQL records in two different tables and the goal
My goal is to get various SEO-relevant information for various sites. Basically all the
I am trying to get my head around a LINQ issue. The ultimate goal
My Goal I would like to have a main processing thread (non GUI), and
I have the following code in child window which is working but what I
I have a table, which contains many columns of float data type with 15
I have done a few projects lately using a Database Object super class which
How can I retrieve GET values inside a PHP Class construct or functions? Similar

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.