TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,972
  • Latest: Lineo
Stats
  • Total Posts: 196,090
  • Total Topics: 21,342
  • Online today: 528
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 145
  • Total: 145

MySQL Help

Started by gfxindia, July 30, 2006, 04:31:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gfxindia

I am wanting to add a new field to a database table.
But i get this error.
Error

SQL query:

ALTER TABLE `simple_messages` ADD `extra` VARCHAR( 25 ) UNSIGNED NOT NULL AFTER `subject`

MySQL said: Documentation
#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 'UNSIGNED NOT NULL AFTER `subject`' at line 1

Please Could somebody help me .

eeek


ALTER TABLE `simple_messages` ADD `extra` VARCHAR( 20 ) NOT NULL AFTER `subject` ;

Is UNSIGNED not related to numbers (int, bigint, etc) which you dont have.

gfxindia

So what should i do ?

eeek

Dont know :)

Depends what it for? and what your trying to do? and how critical it is? why it has UNSIGNED in it for a start?

Whats going to be in the "extra" field?  - up to 20 Characters (VARCHAR( 20 )) just now ? if thats ok then UNSIGNED doesnt apply

so use

ALTER TABLE `simple_messages` ADD `extra` VARCHAR( 20 ) NOT NULL AFTER `subject` ;




gfxindia

I'll try this
The extra is going to be some piece of text

gfxindia


This website is proudly hosted on Crocweb Cloud Website Hosting.