Create DB Table

Started by Xarcell, February 25, 2010, 09:43:54 PM

Previous topic - Next topic

Xarcell

I'm having problems with a mod I'm using for SMF 2.0.

It won't create the DB table, it gives an error instead. How can I create one manually with the information from the script?

$result = db_query("CREATE TABLE IF NOT EXISTS jquiz_scores
   (ID_MEMBER smallint(5) NOT NULL default 0,
ID_QUIZ varchar(20) NOT NULL default '',
correct smallint(5) NOT NULL default 0,
questions smallint(5) NOT NULL default 0,
points smallint(5) NOT NULL default 0,
tot_pts smallint(5) NOT NULL default 0,
passed enum('N', 'Y') NOT NULL default 'N',
eff_date datetime NOT NULL,
pend_change enum(' ', 'P') NOT NULL default ' ',
pend_add smallint(5) NOT NULL default 0,
pend_drop smallint(5) NOT NULL default 0,
misc text NOT NULL default ' ',
PRIMARY KEY (ID_MEMBER, ID_QUIZ)
)", __FILE__, __LINE__);

m.c

That code looks as though it's for SMF1.
SMF2 code should use $smcFunc['db_create_table'] as listed here

Advertisement: