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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:16:28+00:00 2026-06-04T20:16:28+00:00

I can’t get my NOT EXISTS mysql statement to work and it’s driving me

  • 0

I can’t get my NOT EXISTS mysql statement to work and it’s driving me mad now:

$ancestors = mysql_query('
    SELECT * FROM comments e
        WHERE 
            ancestors = "' . $comment["id"] . '" AND 
            user_id != "' . $user->user_object["id"] . '" AND
                NOT EXISTS
                    (
                        SELECT  null 
                        FROM    notifications d
                        WHERE   d.target_id = e.id
                    )
', $database->connection_handle);

Any ideas?

ERROR:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /<>/<>/functions.php on line 785

Line 785:

    while($reply = mysql_fetch_array($ancestors, MYSQL_ASSOC)){

If I do this:

$ancestors = mysql_query('SELECT * FROM ' . $database->db_prefix . 'comments 
    WHERE    
        ancestors = "' . $comment["id"] . '" AND 
        user_id != "' . $user->user_object["id"] . '"', 
        $database->connection_handle
);

It returns my results i expect.

the notifications table does contain an entry

mysql var dump =

string(46) "Table 'whatever_co.comments' doesn't exist"

//SOLVED:::
‘ . $database->db_prefix . ‘ was missing from my table selectors.

  • 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-06-04T20:16:29+00:00Added an answer on June 4, 2026 at 8:16 pm

    I was missing my table prefix: ‘ . $database->db_prefix . ‘ from comments and notifications. The reason for the question was its the first time i have used not exists.. and was assuming that was the part that was incorrect. Thanks for all your time. This causes for celebration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
Can someone please explain why this doesn't work? MyClass myClass1 = new MyClass(); object
Can some one Guide me to work with these things... What is Model popup
can anyone tell me why this doesn't work? db = openOrCreateDatabase(database.db, SQLiteDatabase.CREATE_IF_NECESSARY, null); db.setLocale(Locale.getDefault());
Can't work out a way to make an array of buttons in android. This
Can anyone help me trying to find out why this doesn't work. The brushes
Can't seem to get the Back Button to appear in a UINavigationController flow. I
Does anyone know how can I replace this 2 symbol below from the string
Can i get the source code for a WAMP stack installer somewhere? Any help
Can anybody please tell me why the removeEventListener call is not working? this.addEventListener(Event.ENTER_FRAME, eventCall,

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.