Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Linking table to table php

$
0
0

Hi

 

If I create example section and under section category linking to each other how can I do

 

and this is my tables

 

$inf_newtable[1] = "".$db_prefix."section (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `photo` varchar(255) NOT NULL default 'no-photo.jpg',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;";
 
$inf_newtable[2] = "".$db_prefix."category (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `section_id` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;";

Viewing all articles
Browse latest Browse all 13200

Trending Articles