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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:44:58+00:00 2026-05-19T21:44:58+00:00

I am getting this error message: ————————— You have an error in your SQL

  • 0

I am getting this error message:


————————— 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 ‘(title) VALUES (hi)’ at line
1

————————— OK

And yeah, I know it’s something to do with the syntax. The problem is, I have tried many variations of it and still can’t get it to work, so then I went to 5 sites I found on google with tutorials, and still the same problem. Here’s my code below:

Note: The values inside the Text Property of the text box controls listed below is just plain text, all letters and numbers.

try
            {
                label1.Text = "Trying to save. Wait.";
                conn.Open();
                string sql = "UPDATE " + pagelist.Text + "SET " + itemlist.Text + "=" + sitetext.Text;
                MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand(sql, conn);
                cmd.ExecuteNonQuery();
            }
            catch (Exception en)
            {
                MessageBox.Show(en.Message);
            }

About the table:

table has 3 columns “heading, title and text”. all are varchars and the length of each one is 255

Can someone please help me figure out what’s wrong about this? Any help at all is appreciated.

Thank you

  • 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-19T21:44:59+00:00Added an answer on May 19, 2026 at 9:44 pm

    I think you forgot a space before SET.
    If it is text and not number field, you must also surround value with single quotes.
    But please throw this code away and write a different one that uses parameters.

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

Sidebar

Related Questions

Im getting this error message randomly: Index was outside the bounds of the array.
For some reason, I'm getting this error message: Uncaught TypeError: Object #<an Object> has
For some reason, I'm getting this error message: Uncaught SyntaxError: Unexpected token < For
I am getting this error, and cant figure out what the issue is. Server
I'm trying to send SMTP e-mails using PHPMailer, but I keep getting this error
I try to add client side validation using this line of code: @Html.EnableClientValidation() But
So this is my problem. I used Capistrano to deploy my Rails 3 app
When trying to start up my Android AVD emulator, I get the following error
I am creating a dynamic CSS file in ASP.NET MVC2, and I'm now encountering
I've just begun experimenting with nested masters in MVC2. I'm not quite sure why

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.