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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:43:15+00:00 2026-06-08T20:43:15+00:00

I am having a very strange problem inserting values into my mysql database, using

  • 0

I am having a very strange problem inserting values into my mysql database, using php, so i was running a test, the simplest of the simple insert; the following doesnt work:

<?php
include("config.php"); // put the *FULL* path to the file.

mysql_query("INSERT INTO 'lms'.'test2' ('trn') VALUES ('17')");

?>

However the following works:(Note the difference in single quotes)

<?php
include("config.php"); // put the *FULL* path to the file.

mysql_query("INSERT INTO `lms`.`test2` (`trn`) VALUES ('17')");

?>

I really can’t see what the problem is could I get sum assistance please

  • 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-08T20:43:17+00:00Added an answer on June 8, 2026 at 8:43 pm

    You don’t need to encapsulate tables within a query unless they have space or they are reserved words.

    INSERT INTO 'lms'.'test2' ('trn') VALUES ('17')
    // This makes no real sense to the db. It should be:
    INSERT INTO lms.test2 (trn) VALUES ('17')
    

    If the column trn accepts numbers, it really should be:

    INSERT INTO lms.test2 (trn) VALUES (17)
    

    With MySQL, you can use the tilted quote character to encapsulate names, but not strings. To enter a string in the query you will have to use normal quotes like '.

    You can to this:

    select `someTable`.`someColumn` from `someTable`
    

    but not this:

    select someTable.someColumn from someTable where myName=`Tommy`;
    

    The correct use would be:

    select someTable.someColumn from someTable where myName='Tommy';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a very strange problem. I'm remote desktoping into a system and running
I'm having a very strange problem. I'm using dfs-datastores Pail abstraction to write data
I am having a very strange problem in a simple program and have been
I'm having a very strange problem with statuicon. I'm doing on a simple project
I'm having a very strange problem. I'm running a loop in a detached thread,
I faced a very strange problem when developing on PHP and MySQL. I had
I am having a very strange problem with an ASP.Net project using an Entity
I'm having a very strange problem. I'm using Visual Studio 2010 Ultimate on Windows
I've been having a very strange problem. I have a test class that subclasses
Im having a very strange problem, i have a complicated view that returns incorrect

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.