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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:00:01+00:00 2026-05-31T19:00:01+00:00

I am confronted to a problem that is driving me crazy. I really do

  • 0

I am confronted to a problem that is driving me crazy. I really do not get it. Here below a very simple table creation. I would like to use a variable to name the table. And it is not working!!!!! If I replace the variable by a “handwriten” name, it works… What the…. Thank you in advance for your replies. Cheers. Marc. In case I did not mentionne it, it is driving me crazy.

$processid = mysql_thread_id();

mysql_select_db("mydb", $con);
$sql = 'CREATE TABLE '.$processid.'
(
bat_file varchar(255), 
bat_file_date datetime, 
bat_file_misc varchar(255), 
bat_titre varchar(255), 
bat_lien varchar(255)
)';

mysql_query($sql,$con);
  • 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-31T19:00:02+00:00Added an answer on May 31, 2026 at 7:00 pm

    The return value of mysql_thread_id is not a valid name for a table unless you quote it:

    Certain objects within MySQL, including database, table, index,
    column, alias, view, stored procedure, partition, and other object
    names are known as identifiers.

     ...
    

    Identifiers may begin with a digit but unless quoted may not consist
    solely of digits.

    Since the quote character is the backtick, it should work if you change it to

    $sql = 'CREATE TABLE `'.$processid.'` ... ';
    

    I don’t know why you want to create a table named after a mysql_thread_id (it sounds really fishy), but even if there is a perfectly good reason it might be a good idea to add a prefix in front so that you don’t have to quote it each time.

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

Sidebar

Related Questions

Confronted with the problem - ////////////////// GbCapacityEntity class ////////////////// @Entity @Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.NONE) @Table(name
I am hoping that someone around here already confronted this error and is an
I am confronted to a weird situation that I can't explain. Here is my
Actually I am confronted with a Problem. I've got a .apk-File in one Package
I am confronted with a new kind of problem which I haven't encountered yet
I am confronted with a problem where I have a massive list of information
I see myself regularly confronted with the following problem. I have some kind of
Here is an issue I've confronted in multiple user-facing applications: a program contains components
For various reasons that aren't too germane to the question, I've got a table
When creating a Funds or Assets table, I am often confronted with the same

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.