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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:19:22+00:00 2026-06-17T00:19:22+00:00

Possible Duplicate: Whats wrong with this query mysql? I am using mysql and php

  • 0

Possible Duplicate:
Whats wrong with this query mysql?

I am using mysql and php to update a record. Here is my code:

$n=mysql_query("UPDATE chondas SET model='$model1', yearstart=$yearstart1,
                yearstop=$yearstop1, desc='$desc1', hp='$hp1', 
                engine='$engine1',trim='$trim1', weight='$weight1' WHERE id=$id1");

In the following code if I take out desc='$desc1' everything works perfectly. What would cause this error?

When i tested the following code in phpmyadmin I got this error:

#1064 – 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 ‘desc=’text of the textarea’ at line 1.

  • 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-17T00:19:23+00:00Added an answer on June 17, 2026 at 12:19 am

    DESC is a reserved word in mysql so you need to use backticks:

    UPDATE chondas SET model='$model1', yearstart=$yearstart1, yearstop=$yearstop1, `desc`='$desc1', hp='$hp1', engine='$engine1',trim='$trim1', weight='$weight1' WHERE id=$id1
    

    You should also switch to PDO (or mysqli) and prepared statements with bound variables to avoid potential sql injection.

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

Sidebar

Related Questions

Possible Duplicate: Why does this code crash? Please tell me whats wrong with the
Possible Duplicate: How to resize an image using PHP? Here's what I've tried: $image
Possible Duplicate: What is wrong with this SQL Server query division calculation? I am
Possible Duplicate: What's wrong with this division? If you divide 2 / 3 ,
Possible Duplicate: What’s wrong with my PHP curl request, please help .. I’m not
Possible Duplicate: Xcode 4.2 showing the wrong line of code on error Xcode 4's
Possible Duplicate: Javascript - array.contains(obj) What's wrong with this: var zipCodes =(['90001','90002','90003']); Test if
Possible Duplicate: How to parse and process HTML with PHP? I expect this one
Possible Duplicate: Why is glReadPixels() failing in this code in iOS 6.0? I currently
Possible Duplicate: [PHP/JavaScript]: Call PHP file through JavaScript code with argument Ok so I

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.