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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:57:55+00:00 2026-06-17T22:57:55+00:00

SQL Code: SELECT id, album_date AS timestamp, CONCAT((SELECT detail_value FROM people_db.user_details_tbl WHERE detail_field =

  • 0

SQL Code:

SELECT id, album_date AS timestamp, CONCAT((SELECT detail_value
FROM people_db.user_details_tbl WHERE detail_field = 'first_name' AND user_id = pictures_db.albums.owner), ' uploaded pictures!') AS title_html 
FROM pictures_db.albums 
WHERE id IN 
(SELECT DISTINCT(album_id) 
FROM pictures_db.album_pics 
WHERE pic_id IN 
    (SELECT DISTINCT(picture_id) 
    FROM pictures_db.picture_access_tbl 
    WHERE grantee_group_id IN 
        (SELECT group_id 
        FROM people_db.group_membership_tbl
        WHERE member_id = '2'
        )
     )
);

PHP Code:

$albums_sql = mysql_query("SELECT id, album_date AS timestamp, CONCAT((SELECT detail_value 
    FROM people_db.user_details_tbl 
    WHERE detail_field = 'first_name' AND user_id = pictures_db.albums.owner), ' uploaded pictures!') AS title_html 
    FROM pictures_db.albums 
    WHERE id IN (
          SELECT DISTINCT(album_id) 
          FROM pictures_db.album_pics 
          WHERE pic_id IN (
              SELECT DISTINCT(picture_id) 
              FROM pictures_db.picture_access_tbl 
              WHERE grantee_group_id IN (
                  SELECT group_id 
                  FROM people_db.group_membership_tbl 
                  WHERE member_id = '2'
                  )
               )
             )") or die(mysql_error());

When the PHP is run, the error is: Table ‘pictures_db.albums’ doesn’t exist

I tried executing as the same user, regranted all permissions, and even flushed privileges. Works in shell, not in PHP.
Any ideas?

  • 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-17T22:57:56+00:00Added an answer on June 17, 2026 at 10:57 pm

    The error message is quite clear: MySQL sees the database pictures_db but not the table albums.

    That could be due to permissions, but you seem to have checked that thoroughly.

    Another possible reason is that the connection string you’re using in PHP points to a different database instance than the one you’re using at the command line. Perhaps the connection string still points to a different environment, such as DEV but you’re in QA or points to an old test version of the database?

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

Sidebar

Related Questions

I use this code to select password field from the sql server 2012 db,
I normally use the following code in SQL Server: IF EXISTS (SELECT * FROM
I have the code below: string SQL = select * from + TableName; using
I have the following SQL code: select @colNames = coalesce(@colNames+',','')+''''+ RptLOB1 +'''' from CM.Correlation
I have the following SQL code: select val.PersonNo, val.event_time, clg.number_dialed from vicidial_agent_log val join
What is the difference between the following pieces of SQL code: select count(*) from
This is my sql code SELECT M.PartNo AS ModulePartNo, (SELECT SUM(Delivered - Allocated) FROM
I have this SQL code: SELECT t1.offname, t2.offname, t3.offname, t4.offname, t5.offname, t6.offname, t7.offname FROM
I have the following SQL code: SELECT eml AS Email Address FROM emailtbl WHERE
I'm using a prepared statement with this SQL code: SELECT `name` FROM `securities` WHERE

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.