к примеру есть 2 таблицы
CREATE TABLE IF NOT EXISTS `users` ( -- table for user data(auth,simply profile page and etc)
`id` int(8) NOT NULL AUTO_INCREMENT,
`name` varchar(30)NOT NULL,
`email` varchar(60) NOT NULL,
`password` varchar(40) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDb DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS `posts`(
`post_id` int(8) NOT NULL AUTO_INCREMENT,
`title` varchar(30) NOT NULL,
`body` text NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_id` int(8) NOT NULL,
PRIMARY KEY (`post_id`)
)ENGINE=InnoDb DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
ALTER TABLE `posts`
ADD FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
Как можно добавить авторов статей на страницу?