PDA

View Full Version : Create table if not exists


Stickers
01-16-2009, 05:27 PM
Hi all..

Im trying to add in the userfield a new table, but wheb i run this..
i dont see the sound table in the database..

any idea's?

CREATE TABLE IF NOT EXISTS `userfield` (
`userid` int(10) unsigned NOT NULL default '0',
`temp` mediumtext,
`field1` mediumtext,
`field2` mediumtext,
`field3` mediumtext,
`field4` mediumtext,
`sound` mediumtext,
PRIMARY KEY (`userid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Best regards..

--------------- Added 1232155874 at 1232155874 ---------------

anyone???

Dismounted
01-17-2009, 10:44 AM
The table "userfield" is a vBulletin table, and already exists on an installation of vBulletin. Your query creates a table if it does not exist. What you are looking for is to alter the user table, not userfield.

Stickers
01-17-2009, 04:52 PM
sow there is no way to add the tablename sound in the userfield table?

Dismounted
01-18-2009, 03:34 AM
Use the ALTER command on the user table.

ALTER TABLE Syntax (http://dev.mysql.com/doc/refman/5.0/en/alter-table.html)

Marco van Herwaarden
01-18-2009, 08:16 AM
Your question is very confusing. You are trying to add a table to another table?