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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:07:13+00:00 2026-06-09T06:07:13+00:00

I am encountering one little problem here: I am entering one MySQL query through

  • 0

I am encountering one little problem here:

I am entering one MySQL query through PHP. I have checked the connection works fine and looks like the following:

INSERT INTO table (q1,q2,q3) VALUES ('".$_POST['Q1']."', '".$_POST['Q2']."'...)

then when I change the query to the following, there is an error:

INSERT INTO table (q1,q2,q3-1) VALUES ('".$_POST['Q1']."', '".$_POST['Q2']."'...)

The following error appears:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-1) VALUES (‘N’, ‘asdfasdf’, ” )’ at line 1

Now, I am thinking, is it because:

  1. I name the table column as ‘q3-1’
  2. or any other problem?

Would it be okay if I change it to q3_1 instead?

  • 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-09T06:07:14+00:00Added an answer on June 9, 2026 at 6:07 am

    You have error in your second query because of q3-1. It should be in quotes :

    INSERT INTO table (q1,q2,`q3-1`) VALUES ('".$_POST['Q1']."', '".$_POST['Q2']."'...)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is one very simple question(or at least at first sight).Let's say we have
I'm encountering the following problem - I have simple GWT overlay types, and I'm
I am currently encountering a problem while running a query which is calling a
I'm encountering a problem with a Doctrine 2 entity association. I have a User
I'm encountering a problem with one of my IEnumerable 's that I haven't seen
Im encountering a problem with pypi similar to this one, except that I'm running
I'm encountering a strange behavior of MySQL. Query execution (i.e. the usage of indexes
I'm encountering a problem whereby i have fields in a form that has variable
I am encountering an odd issue whereby I can move items from one list
I am encountering problems writing XML files using PHP. The following is my php

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.