RajeevK
RajeevK

Reputation: 418

MySQL Error #1064 - I tried many options

I tried adding a column at the end of the table by selecting the options in phpmyadmin but it throws me error. I copied the query and tried with SQL option in there by removing the quote & removing all the argument but it still gives error -

I tried -

ALTER TABLE `signup_event` ADD `payment_category` VARCHAR( 30 ) UNSIGNED NULL
    DEFAULT NULL AFTER `trans_status`;

ALTER TABLE signup_event ADD payment_category VARCHAR( 30 ) UNSIGNED NULL
    DEFAULT NULL AFTER trans_status;

ALTER TABLE signup_event ADD payment_category VARCHAR( 30 ) UNSIGNED NULL
    DEFAULT NULL AFTER trans_status

ALTER TABLE signup_event ADD payment_category VARCHAR( 30 ) UNSIGNED
    DEFAULT NULL AFTER trans_status;

Like this many times...

How to add a column in this case?

Upvotes: 1

Views: 73

Answers (1)

John Woo
John Woo

Reputation: 263693

You have defined UNSIGNED on varchar. UNSIGNED can only be used in numbers.

ALTER TABLE signup_event 
    ADD payment_category VARCHAR(30)  
    DEFAULT NULL AFTER trans_status;

Upvotes: 2

Related Questions