skip to Main Content

I Created the db with phpmyadmin and created 8 columns i forgot to create date column i tried to create it with this code and i got this

ALTER TABLE "users" ADD "cdate" DATE

1064 – You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use
near ‘”users” ADD “cdate” DATE’ at line 1

4

Answers


  1. you can add columns to existing table using phpmyadmin
    below the table structure you can find add [num] columns

    and since you asked

    ALTER TABLE `users` ADD `cdate` DATE
    
    Login or Signup to reply.
  2. Read about this in the documentation https://dev.mysql.com/doc/refman/8.0/en/alter-table.html

    ALTER TABLE table_name ADD column_name column_definition
    
    Login or Signup to reply.
  3. You can Use phpmyadmin to add a new column without any code

    Or Use this :

    ALTER TABLE `users` ADD `cdate` DATE
    

    You should use this ` not this “

    Login or Signup to reply.
  4. you dont need any qoute

    ALTER TABLE users ADD cdate DATE
    

    Backticks are to be used for table and column identifiers, but are only necessary when the identifier is a reserve word of mysql

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search