01. januar 2002 - 21:15
#13
her er tabellen & lidt data far tabellen forums
CREATE TABLE forums (
id int(10) unsigned DEFAULT \'0\' NOT NULL auto_increment,
name char(50) NOT NULL,
active smallint(6) DEFAULT \'0\' NOT NULL,
description char(255) NOT NULL,
config_suffix char(50) NOT NULL,
folder char(1) DEFAULT \'0\' NOT NULL,
parent int(10) unsigned DEFAULT \'0\' NOT NULL,
display int(10) unsigned DEFAULT \'0\' NOT NULL,
table_name char(50) NOT NULL,
moderation char(1) DEFAULT \'n\' NOT NULL,
email_list char(50) NOT NULL,
email_return char(50) NOT NULL,
email_tag char(50) NOT NULL,
check_dup smallint(5) unsigned DEFAULT \'0\' NOT NULL,
multi_level smallint(5) unsigned DEFAULT \'0\' NOT NULL,
collapse smallint(5) unsigned DEFAULT \'0\' NOT NULL,
flat smallint(5) unsigned DEFAULT \'0\' NOT NULL,
lang char(50) NOT NULL,
html char(40) DEFAULT \'N\' NOT NULL,
table_width char(4) NOT NULL,
table_header_color char(7) NOT NULL,
table_header_font_color char(7) NOT NULL,
table_body_color_1 char(7) NOT NULL,
table_body_color_2 char(7) NOT NULL,
table_body_font_color_1 char(7) NOT NULL,
table_body_font_color_2 char(7) NOT NULL,
nav_color char(7) NOT NULL,
nav_font_color char(7) NOT NULL,
allow_uploads char(1) DEFAULT \'N\' NOT NULL,
upload_types char(100) NOT NULL,
upload_size int(10) unsigned DEFAULT \'0\' NOT NULL,
max_uploads int(10) unsigned DEFAULT \'0\' NOT NULL,
security int(10) unsigned DEFAULT \'0\' NOT NULL,
showip smallint(5) unsigned DEFAULT \'1\' NOT NULL,
emailnotification smallint(5) unsigned DEFAULT \'1\' NOT NULL,
body_color char(7) NOT NULL,
body_link_color char(7) NOT NULL,
body_alink_color char(7) NOT NULL,
body_vlink_color char(7) NOT NULL,
PRIMARY KEY (id),
KEY name (name),
KEY active (active),
KEY parent (parent)
);
#
# Data dump for tabellen forums
#
INSERT INTO forums VALUES (28, \'A. Generelt\', 1, \'\', \'\', \'0\', 6, 30, \'a3\', \'n\', \'\', \'\', \'\', 1, 2, 1, 0, \'lang/danish.php\', \'Y\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'Y\', \'gif;jpg;jpeg;png\', 1000, 4, 1, 0, 1, \'\', \'\', \'\', \'\');
INSERT INTO forums VALUES (18, \'A. Før konfirmationen\', 1, \'\', \'\', \'0\', 5, 30, \'a2\', \'n\', \'\', \'\', \'\', 1, 2, 1, 1, \'lang/danish.php\', \'Y\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'N\', \'\', 1000, 4, 2, 1, 1, \'\', \'\', \'\', \'\');
INSERT INTO forums VALUES (3, \'1. Bryllup\', 1, \'Debatgruppe for Bryllup \', \'\', \'1\', 0, 0, \'\', \'n\', \'\', \'\', \'\', 0, 0, 0, 0, \'lang/danish.php\', \'Y\', \'\', \'#ba5e67\', \'#eFe2e3\', \'#FFF2C3\', \'\', \'#222222\', \'\', \'#990033\', \'#eFe2e3\', \'N\', \'\', 0, 0, 0, 1, 1, \'#990033\', \'#222222\', \'#990033\', \'#222222\');
INSERT INTO forums VALUES (5, \'2. Konfirmation.dk\', 1, \'Debatgruppe for Konfirmation\', \'\', \'1\', 0, 0, \'\', \'n\', \'\', \'\', \'\', 0, 0, 0, 0, \'lang/danish.php\', \'Y\', \'\', \'#000000\', \'#3399FF\', \'#7dbeff\', \'\', \'#000066\', \'\', \'#3399FF\', \'\', \'N\', \'\', 0, 0, 0, 1, 1, \'#3399FF\', \'#000066\', \'#3399FF\', \'#000066\');
INSERT INTO forums VALUES (6, \'3. Selskabslokaler.dk\', 1, \'Debatgruppe for Selskabslokaler\', \'\', \'1\', 0, 0, \'\', \'n\', \'\', \'\', \'\', 0, 0, 0, 0, \'lang/danish.php\', \'Y\', \'\', \'\', \'\', \'#FFFFFF\', \'\', \'#546A53\', \'\', \'\', \'\', \'N\', \'\', 0, 0, 0, 1, 1, \'\', \'#546A53\', \'#546A53\', \'#546A53\');
INSERT INTO forums VALUES (7, \'4. Barnedåb\', 1, \'Debatgruppe for barnedåb - alt om navne, skikke m.m.\', \'\', \'1\', 0, 0, \'\', \'n\', \'\', \'\', \'\', 0, 0, 0, 0, \'lang/danish.php\', \'Y\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'N\', \'\', 0, 0, 0, 1, 1, \'\', \'\', \'\', \'\');
INSERT INTO forums VALUES (8, \'5. Højtider & traditioner\', 0, \'Debatgruppe for alle traditioner og højtider. Jul, påske, Halloween etc.\', \'\', \'1\', 0, 0, \'\', \'n\', \'\', \'\', \'\', 0, 0, 0, 0, \'lang/danish.php\', \'Y\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'N\', \'\', 0, 0, 0, 1, 1, \'\', \'\', \'\', \'\');
INSERT INTO forums VALUES (9, \'A. Forberedelserne\', 1, \'\', \'\', \'0\', 3, 30, \'a1\', \'n\', \'\', \'\', \'\', 1, 2, 1, 0, \'lang/danish.php\', \'Y\', \'\', \'#ba5e67\', \'#eFe2e3\', \'#FFF2C3\', \'#FFF2C3\', \'#222222\', \'#222222\', \'#990033\', \'#eFe2e3\', \'Y\', \'gif;jpg;jpeg;png;bmp\', 1000, 4, 1, 0, 1, \'#990033\', \'#990033\', \'#990033\', \'#222222\');
INSERT INTO forums VALUES (10, \'B. Selve vielsen\', 1, \'\', \'\', \'0\', 3, 30, \'b1\', \'n\', \'\', \'\', \'\', 1, 2, 1, 0, \'lang/danish.php\', \'Y\', \'\', \'#ba5e67\', \'#eFe2e3\', \'#FFF2C3\', \'#FFF2C3\', \'#222222\', \'#222222\', \'#990033\', \'#eFe2e3\', \'Y\', \'gif;jpg;jpeg;png;bmp\', 1000, 4, 1, 0, 1, \'#990033\', \'#990033\', \'#990033\', \'#222222\');
INSERT INTO forums VALUES (11, \'C. Reception & fest\', 1, \'\', \'\', \'0\', 3, 30, \'c1\', \'n\', \'\', \'\', \'\', 1, 2, 1, 1, \'lang/danish.php\', \'Y\', \'\', \'#ba5e67\', \'#eFe2e3\', \'#FFF2C3\', \'#FFF2C3\', \'#222222\', \'#222222\', \'#990033\', \'#eFe2e3\', \'Y\', \'gif;jpg;jpeg;png;bmp\', 1000, 4, 1, 0, 1, \'#990033\', \'#990033\', \'#990033\', \'#222222\');
INSERT INTO forums VALUES (12, \'D. Efter brylluppet\', 1, \'\', \'\', \'0\', 3, 30, \'d1\', \'n\', \'\', \'\', \'\', 1, 2, 1, 1, \'lang/danish.php\', \'Y\', \'\', \'#ba5e67\', \'#eFe2e3\', \'#FFF2C3\', \'#FFF2C3\', \'#222222\', \'#222222\', \'#990033\', \'#eFe2e3\', \'Y\', \'gif;jpg;jpeg;png;bmp\', 1000, 4, 2, 0, 1, \'#990033\', \'#990033\', \'#990033\', \'#222222\');
INSERT INTO forums VALUES (13, \'E. Tøj / sko\', 1, \'\', \'\', \'0\', 3, 30, \'e1\', \'n\', \'\', \'\', \'\', 1, 2, 1, 1, \'lang/danish.php\', \'Y\', \'\', \'#ba5e67\', \'#eFe2e3\', \'#FFF2C3\', \'#FFF2C3\', \'#222222\', \'#222222\', \'#990033\', \'#eFe2e3\', \'Y\', \'gif;jpg;jpeg;png;bmp\', 1000, 4, 1, 0, 1, \'#990033\', \'#990033\', \'#990033\', \'#222222\');
Her er en af tabellerne og lidt data derfra!
CREATE TABLE i1 (
id int(10) unsigned DEFAULT \'0\' NOT NULL,
datestamp datetime DEFAULT \'0000-00-00 00:00:00\' NOT NULL,
thread int(10) unsigned DEFAULT \'0\' NOT NULL,
parent int(10) unsigned DEFAULT \'0\' NOT NULL,
author char(37) NOT NULL,
subject char(255) NOT NULL,
email char(200) NOT NULL,
host char(50) NOT NULL,
email_reply char(1) DEFAULT \'N\' NOT NULL,
approved char(1) DEFAULT \'N\' NOT NULL,
msgid char(100) NOT NULL,
modifystamp int(10) unsigned DEFAULT \'0\' NOT NULL,
userid int(10) unsigned DEFAULT \'0\' NOT NULL,
PRIMARY KEY (id),
KEY author (author),
KEY userid (userid),
KEY datestamp (datestamp),
KEY subject (subject),
KEY thread (thread),
KEY parent (parent),
KEY approved (approved),
KEY msgid (msgid),
KEY modifystamp (modifystamp)
);
#
# Data dump for tabellen i1
#
INSERT INTO i1 VALUES (1, \'2002-01-01 11:48:44\', 1, 0, \'Anette Hansen\', \'Brudekjole sælges.\', \'xxx@worldonline.dk\', \'xxxx.kd.worldonline.dk\', \'Y\', \'Y\', \'<75e426d318d24244b8d1ecfdb1ebe44e.>\', 1009882124, 10);
INSERT INTO i1 VALUES (2, \'2002-01-01 17:38:56\', 2, 0, \'Katja Pedersen\', \'brudekjole købes\', \'xxx@vip.cybercity.dk\', \'xxx.cvx1-hr.ppp.cybercity.dk\', \'Y\', \'Y\', \'<442f56b3fa764e8e4c9309892875c22e.>\', 1009903136, 11);
INSERT INTO i1 VALUES (3, \'2002-01-01 17:48:50\', 3, 0, \'3/8-Bruden\', \'Corsagekjole str 50 sælges..\', \'xxx@msn.com\', \'xxxx306.boanxx9.adsl.tele.dk\', \'Y\', \'Y\', \'<bba30808d0bdfd849cf27767b7710877.>\', 1009904483, 13);
INSERT INTO i1 VALUES (5, \'2002-01-01 17:56:59\', 3, 3, \'3/8-Bruden\', \'Corsagekjole str 50 sælges..\', \'xxx@msn.com\', \'xxxx306.boanxx9.adsl.tele.dk\', \'Y\', \'Y\', \'<cd8985884f8304472d9795458d8dfde8.>\', 1009904483, 13);
INSERT INTO i1 VALUES (7, \'2002-01-01 19:01:29\', 6, 6, \'3/8-Bruden\', \'Re: Titiara/diadem købes!\', \'xxx@msn.com\', \'xxxx.boanxx9.adsl.tele.dk\', \'Y\', \'Y\', \'<c1aaefb70019b8e299b723fba10de9d8.>\', 1009908089, 13);
INSERT INTO i1 VALUES (6, \'2002-01-01 18:59:23\', 6, 0, \'lillebrud\', \'Titiara/diadem købes!\', \'xxx@jensen.tdcadsl.dk\', \'xxxxx0b50.hrnxx2.adsl-dhcp.tele.dk\', \'Y\', \'Y\', \'<ebcba49f874c98724c16ff305f230681.>\', 1009908089, 0);
Det script jeg postede (som det da jeg oprettede) henter data via en include på min side med denne komando
include(\"hent_nyeste_indlaeg.php?f27&number5\");
men som tidligere skrevet kun fra den tabel der er specificeret i forums i recordet med id nr. 27 (f27)
og så er det at hvis jeg evt. skriver f3
skal der undersøges om der i tabellen forums for record 3 er parent sat til 0 så skal den søge vidre i forums og finde de id numre hvor parent er sat til 3 og så hente alle indlæg ud af alle disse tabeller og så vise de 5 nyeste........
Håber stadig du er med på hvad jeg mener.... ?