Log in

View Full Version : need help with mysql query syntax running it manually


sross
09-27-2006, 09:10 AM
this was in a mod i am installing and i need to run it manually in phpmyadmin but am not sure how:


$db->query_write("
CREATE TABLE " . TABLE_PREFIX . "journal_comments (
comment_id int(10) NOT NULL auto_increment,
journal_id int(10) NOT NULL,
entry_id int(10) NOT NULL,
commenter varchar(50) NOT NULL,
commenter_id int(10) NOT NULL,
comment_title varchar(100) NOT NULL,
comment_text text NOT NULL,
comment_date int(10) NOT NULL,
ipaddress varchar(15) NOT NULL,
PRIMARY KEY (comment_id))
");

i try to run that but it fails and i've tried several changes as a guess with no luck. I'm sure it's simple i just don't know it.. Thanks for any help!

Ranma2k
09-27-2006, 10:36 AM
if there no table prefix use

CREATE TABLE journal_comments (
comment_id int(10) NOT NULL auto_increment,
journal_id int(10) NOT NULL,
entry_id int(10) NOT NULL,
commenter varchar(50) NOT NULL,
commenter_id int(10) NOT NULL,
comment_title varchar(100) NOT NULL,
comment_text text NOT NULL,
comment_date int(10) NOT NULL,
ipaddress varchar(15) NOT NULL,
PRIMARY KEY (comment_id))



if there a table prefix replace " . TABLE_PREFIX . " with it

for example if table prefix is vb_

then the query will be

CREATE TABLE vb_journal_comments (
comment_id int(10) NOT NULL auto_increment,
journal_id int(10) NOT NULL,
entry_id int(10) NOT NULL,
commenter varchar(50) NOT NULL,
commenter_id int(10) NOT NULL,
comment_title varchar(100) NOT NULL,
comment_text text NOT NULL,
comment_date int(10) NOT NULL,
ipaddress varchar(15) NOT NULL,
PRIMARY KEY (comment_id))