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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:16:07+00:00 2026-05-24T17:16:07+00:00

I have a column named read in my table. When I try to perform

  • 0

I have a column named “read” in my table.
When I try to perform operations on it, PHP tells me there’s an error surround ‘read’. From previous experience with this kind of errors, I have determined that the column name ‘read’ is illegal.
The problem is that I can’t rename the column with PHP. Every time I try, I get an error (the same error, actually).
When I go in PHPMyAdmin, and change it there, it works perfectly afterwards.

Any ideas on how I can change the column name with PHP?

  • 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-24T17:16:10+00:00Added an answer on May 24, 2026 at 5:16 pm

    When you say “rename”, do you mean you’re trying to modify the table definition itself, like with ALTER TABLE? If so, there shouldn’t be a difference between your PHP code and PHPMyAdmin (since the latter is itself just PHP code). The only problem you could run into is if you’re logging in as a different database user in your PHP code than you are in PHPMyAdmin. You need to make sure the user has ALTER privileges on that table.

    If you’re only talking about running normal queries on the table, and just want to stop the syntax error from occurring, then you can just wrap your field and/or table names in backticks – i.e. ` usually on the same key as the tilde ~ on the number bar – and MySQL will be able to distinguish between the field name and the reserved word.

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

Sidebar

Related Questions

For example, I have a table, and there is a column named 'Tags'. I
I have a self referencing table named categories that has a parentcategoryid column that
I read this tutorial . I try, but i get error. We have Mysql
I have column named summary (tinytext, utf8_turkish_ci). I know it can store 255 byte
I have ten or more(i don't know) tables that have a column named foo
I have a books model with a date type column named publish_date. On my
I have multiple columns in a mySQL table. Three of the columns are named
I have the fallowing mapping: <class name=Country table=Country lazy=false > <cache usage=read-write/> <id name=Id
I have block of text read from a PDF document, using the ItextSharp library(method:
I know there have been discussions wrt to dbunit here. I have read most

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.