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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:01:07+00:00 2026-05-23T22:01:07+00:00

A previous employee at my office constructed a php script that uses curly braces

  • 0

A previous employee at my office constructed a php script that uses curly braces in the a SQL query. I understand that it would normally work for things like encapsulating array variables, but this query doesn’t have any PHP variables in the string. Can someone clarify what the table being generated in the FROM section of the query is actually requiring the curly braces for, and what the OJ stands for?

SELECT
  DISTINCT ra.folder_id,
  pd.id,
  f.name,
  pd.descriptor_text
FROM
  { 
    OJ permission_descriptors pd
    LEFT JOIN permission_descriptor_users pdu
    ON pdu.descriptor_id = pd.id
  }
  role_allocations ra,
  folders f
WHERE
  pdu.descriptor_id IS NULL AND
  pd.id = ra.permission_descriptor_id AND
  pd.id != 1
  ra.folder_id = f.id
ORDER BY
  ra.folder_id
  • 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-23T22:01:07+00:00Added an answer on May 23, 2026 at 10:01 pm

    MySQL supports this alternative syntax for an Outer Join.
    However that does not mean that it should be used.

    1. It can be problematic to have RDBMS-specific code if at some point you need switch to another RDBMS.
    2. Googling around, it appears that MySQL doesn’t support this syntax for more than 2 joins.

    Aside:
    Another non-ANSI-compliant issue with the code is the subsequent joins.

    This is a quick stab at an ANSI-compliant version (not tested):

    SELECT
      DISTINCT ra.folder_id,
      pd.id,
      f.name,
      pd.descriptor_text
    FROM
      permission_descriptors pd
      LEFT JOIN permission_descriptor_users pdu
      ON pdu.descriptor_id = pd.id
      LEFT JOIN role_allocations ra
      ON pd.id = ra.permission_descriptor_id 
      LEFT JOIN folders f 
      ON ra.folder_id = f.id
    
    WHERE
      pdu.descriptor_id IS NULL AND
      pd.id <> 1 
    ORDER BY
      ra.folder_id;
    

    Other notes:
    For inequality != will work, but <> is preferred.

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

Sidebar

Related Questions

I encountered a PHP class written by a previous employee that is defined like
I was working with a select box today that a previous employee had written.
I have an ant script created by a previous employee of our company and
I have a database that tracks employee’s data for the current year and previous
I am working on a webservice that a previous employee built and I am
Suppose I have a SQL query that looks like this: SELECT fName from employees
At a previous employer, we were writing binary messages that had to go over
From previous post, I learnt that for there are two ways, at least, to
From previous experience I had been under the impression that it's perfectly legal (though
In previous question of mine, someone had meantioned that using Semaphores were expensive in

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.