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

  • Home
  • SEARCH
  • 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 1052789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:09:03+00:00 2026-05-16T17:09:03+00:00

What query would I have to use to check if the querying user has

  • 0

What query would I have to use to check if the querying user has permissions to create temporary tables in the database?

  • 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-16T17:09:03+00:00Added an answer on May 16, 2026 at 5:09 pm

    I do not know if there is an elegant way of doing this with a query, but a “hackish” type of way to do it would be to use a mysql_query() and see if you get a result for that table or an error.

    function checkCreateTempPermission($table) {
         $res = mysql_query("CREATE `$table` "); // modify this to be your temporary table code.
         if ($res === false) {
             if (strstr(mysql_error(), "command denied to user")) {
                  return false;
             }else {
                  // some other error happened not sure how you want to handle it so left blank.
             }
         }else {
             return true;
         }
    }
    

    I have not tested this at all, more or less a theory of how it could be done. Alternatively, you can write a script that runs this SQL:

    Show grants for myuser;
    

    And then loop through that testing if they have access for that table. This would take a bit more work, but at least would not error out. Hope that helps to get you started.

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

Sidebar

Related Questions

I have identified the query constructs my users normally use. Would it make sense
I have a simple LINQ query. I would like to only check the DateDisable
i have three tables i would like to link in this one query. The
I have a list of groups in a SQL query and would like them
How can I return the rows deleted as objects? Would I have to query
I have a MySQL query that I would like to optimize a little bit.
I have a MySQL query where I would like it to have a pseudo
I have one query on which I would like to get your valuable feedback.
I would like to retrieve an ordered query result, but I need to have
I have a specific DB2 query, and I would like to execute this query

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.