|
|
|
ให้แสดงรูปลักษณะนี้ได้อย่างไร ต้องการให้โชว์รูปที่เรียกจากสคริป pic.php ที่ตำแหน่ง |
|
|
|
|
|
|
|
ไม่ได้ครับ
ขอบคุณครับ
|
|
|
|
|
Date :
2009-02-10 13:04:37 |
By :
ruti |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ใน ฐานข้อมูล คุณเก็บเป็นแบบไหนอะครับ
|
|
|
|
|
Date :
2009-02-10 13:26:58 |
By :
ddsure |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ปัญหามันอยู่ที่ ฐานข้อมูลรูปกับชื่อมันอยู่คนละตารางกัน
////////////////////////////////////////////////////////////////////////////////
ที่ต้องการคือ
ชื่อเรื่อง รูปภาพ
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
Date :
2009-02-10 14:28:28 |
By :
ruti |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไม่เอาโค๊ดเอาฐานข้อมูลมาโพสต์ ช่วยแก้ปัญหาลำบากอะครับ
|
|
|
|
|
Date :
2009-02-10 14:49:00 |
By :
plakrim |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตารางที่1เก็บชื่อเรื่อง(topic_title)
CREATE TABLE `board_topics` (
`topic_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`forum_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`icon_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`topic_attachment` tinyint(1) unsigned NOT NULL DEFAULT '0',
`topic_approved` tinyint(1) unsigned NOT NULL DEFAULT '1',
`topic_reported` tinyint(1) unsigned NOT NULL DEFAULT '0',
`topic_title` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '',
`topic_poster` mediumint(8) unsigned NOT NULL DEFAULT '0',
`topic_time` int(11) unsigned NOT NULL DEFAULT '0',
`topic_time_limit` int(11) unsigned NOT NULL DEFAULT '0',
`topic_views` mediumint(8) unsigned NOT NULL DEFAULT '0',
`topic_replies` mediumint(8) unsigned NOT NULL DEFAULT '0',
`topic_replies_real` mediumint(8) unsigned NOT NULL DEFAULT '0',
`topic_status` tinyint(3) NOT NULL DEFAULT '0',
`topic_type` tinyint(3) NOT NULL DEFAULT '0',
`topic_first_post_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`topic_first_poster_name` varchar(255) COLLATE utf8mb3_bin NOT NULL DEFAULT '',
`topic_first_poster_colour` varchar(6) COLLATE utf8mb3_bin NOT NULL DEFAULT '',
`topic_last_post_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`topic_last_poster_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`topic_last_poster_name` varchar(255) COLLATE utf8mb3_bin NOT NULL DEFAULT '',
`topic_last_poster_colour` varchar(6) COLLATE utf8mb3_bin NOT NULL DEFAULT '',
`topic_last_post_subject` varchar(100) COLLATE utf8mb3_bin NOT NULL DEFAULT '',
`topic_last_post_time` int(11) unsigned NOT NULL DEFAULT '0',
`topic_last_view_time` int(11) unsigned NOT NULL DEFAULT '0',
`topic_moved_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`topic_bumped` tinyint(1) unsigned NOT NULL DEFAULT '0',
`topic_bumper` mediumint(8) unsigned NOT NULL DEFAULT '0',
`poll_title` varchar(255) COLLATE utf8mb3_bin NOT NULL DEFAULT '',
`poll_start` int(11) unsigned NOT NULL DEFAULT '0',
`poll_length` int(11) unsigned NOT NULL DEFAULT '0',
`poll_max_options` tinyint(4) NOT NULL DEFAULT '1',
`poll_last_vote` int(11) unsigned NOT NULL DEFAULT '0',
`poll_vote_change` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`topic_id`),
KEY `forum_id` (`forum_id`),
KEY `forum_id_type` (`forum_id`,`topic_type`),
KEY `last_post_time` (`topic_last_post_time`),
KEY `topic_approved` (`topic_approved`),
KEY `forum_appr_last` (`forum_id`,`topic_approved`,`topic_last_post_id`),
KEY `fid_time_moved` (`forum_id`,`topic_last_post_time`,`topic_moved_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin AUTO_INCREMENT=1;
ตารางที่2 เก็บชื่อรูป(physical_filename)
CREATE TABLE `board_attachments` (
`attach_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`post_msg_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`topic_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`in_message` tinyint(1) unsigned NOT NULL DEFAULT '0',
`poster_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`is_orphan` tinyint(1) unsigned NOT NULL DEFAULT '1',
`physical_filename` varchar(255) COLLATE utf8mb3_bin NOT NULL DEFAULT '',
`real_filename` varchar(255) COLLATE utf8mb3_bin NOT NULL DEFAULT '',
`download_count` mediumint(8) unsigned NOT NULL DEFAULT '0',
`attach_comment` text COLLATE utf8mb3_bin NOT NULL,
`extension` varchar(100) COLLATE utf8mb3_bin NOT NULL DEFAULT '',
`mimetype` varchar(100) COLLATE utf8mb3_bin NOT NULL DEFAULT '',
`filesize` int(20) unsigned NOT NULL DEFAULT '0',
`filetime` int(11) unsigned NOT NULL DEFAULT '0',
`thumbnail` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`attach_id`),
KEY `filetime` (`filetime`),
KEY `post_msg_id` (`post_msg_id`),
KEY `topic_id` (`topic_id`),
KEY `poster_id` (`poster_id`),
KEY `is_orphan` (`is_orphan`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin AUTO_INCREMENT=1 ;
ขอบคุณครับ
|
|
|
|
|
Date :
2009-02-10 15:25:01 |
By :
ruti |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|