Jump to content

Recommended Posts

hi,

 

i want to retrieve data multiple table using joining. All table has different field name only one field is common example (category_id).

so please help me

 

i sending attachment image. data will be show like this image..

 

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/226212-to-retrieve-data-using-joining/
Share on other sites

Video Table Structure:

 

CREATE TABLE IF NOT EXISTS `videos` (

  `id` int(11) NOT NULL AUTO_INCREMENT,

  `video_title` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '',

  `video_description` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '',

  `video_keywords` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '',

  `video_thumbnail` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '',

  `video_file` varchar(255) COLLATE latin1_general_ci NOT NULL,

  `video_url` text COLLATE latin1_general_ci NOT NULL,

  `category_id` int(11) NOT NULL DEFAULT '0',

  `final_rating` float NOT NULL DEFAULT '0',

  `video_date` date NOT NULL DEFAULT '0000-00-00',

  `video_status` int(11) NOT NULL DEFAULT '0',

  `hit` int(11) NOT NULL,

  `activate_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

  `mem_id` int(11) NOT NULL,

  PRIMARY KEY (`id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT ;

 

*****************************************************

Articles Table.........

 

CREATE TABLE IF NOT EXISTS `article` (

  `art_id` int(11) NOT NULL AUTO_INCREMENT,

  `category_id` int(11) NOT NULL,

  `art_title` varchar(255) NOT NULL,

  `art_desc` text NOT NULL,

  `art_thumbnail` varchar(100) NOT NULL,

  `art_url` varchar(255) NOT NULL,

  `final_rating` float NOT NULL,

  `art_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

  `art_status` int(4) NOT NULL,

  `hit` int(11) NOT NULL,

  `mem_id` int(11) NOT NULL,

  PRIMARY KEY (`art_id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT ;

 

******************************************************

Picture Gallery Table---

CREATE TABLE IF NOT EXISTS `picture_gallery` (

  `g_id` int(11) NOT NULL AUTO_INCREMENT,

  `category_id` int(11) NOT NULL,

  `gallery_title` varchar(255) NOT NULL,

  `gallery_desc` varchar(255) NOT NULL,

  `gallery_thumbnail` varchar(100) NOT NULL,

  `picture_url` varchar(255) NOT NULL,

  `final_rating` float NOT NULL,

  `gallery_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',

  `gallery_status` int(4) NOT NULL,

  `hit` int(11) NOT NULL,

  `activate_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

  `mem_id` int(11) NOT NULL,

  PRIMARY KEY (`g_id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMEN;

 

***********************************************************

Games Table Structure---------

CREATE TABLE IF NOT EXISTS `games` (

  `id` int(11) NOT NULL AUTO_INCREMENT,

  `game_title` varchar(255) NOT NULL,

  `game_desc` text NOT NULL,

  `game_keywords` varchar(255) NOT NULL,

  `game_thumbs` varchar(100) NOT NULL,

  `game_file` varchar(255) NOT NULL,

  `game_url` varchar(255) NOT NULL,

  `category_id` int(11) NOT NULL,

  `final_rating` float NOT NULL,

  `game_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',

  `game_status` int(4) NOT NULL,

  `hit` varchar(40) NOT NULL,

  `activated_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',

  `mem_id` int(11) NOT NULL,

  PRIMARY KEY (`id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT;

 

These are the All Table Structures in which have to get join and retrieve all data

 

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.