Notification Data table is:
as per user defined functionality , user want notification as per particular any user send.
if you want particular notification please follow following database structure :
Normally we can use following data table structure INNODB database use because mostly common used that, its very fast loading and primary and forgen key assign.
Free Teachnology provide free php tutorial as well as MySql,javascript,jquery knowlege :

above image show that basic notification table structure pk_id is primary key of notification table , fk_uid is forgin key of user table of particular user primary key,
Following code is create notification table :
above notification table required read,unread status because particular user notification you fetch at that time know that this particular user notification is read or not, when notification read then change status of notification table
ip address is filed store ip address of created notification its generally used for notify information,
Hope that you understand how to create notification and how to store into database
as per user defined functionality , user want notification as per particular any user send.
if you want particular notification please follow following database structure :
Normally we can use following data table structure INNODB database use because mostly common used that, its very fast loading and primary and forgen key assign.
Free Teachnology provide free php tutorial as well as MySql,javascript,jquery knowlege :

above image show that basic notification table structure pk_id is primary key of notification table , fk_uid is forgin key of user table of particular user primary key,
Following code is create notification table :
-- phpMyAdmin SQL Dump -- version 4.5.2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jun 07, 2018 at 12:16 PM -- Server version: 10.1.13-MariaDB -- PHP Version: 5.6.20 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- -- Database: `makeathome` -- -- -------------------------------------------------------- -- -- Table structure for table `notification` -- CREATE TABLE `notification` ( `pk_id` int(250) NOT NULL, `fk_uid` int(250) DEFAULT NULL, `status` enum('1','2','3') NOT NULL DEFAULT '1' COMMENT '1-pending,2-accept,3-decline', `title` text COMMENT 'message notification', `created_date` datetime NOT NULL COMMENT 'created date and time', `updated_date` datetime NOT NULL COMMENT 'updated date and time', `read_status` enum('1','2') NOT NULL DEFAULT '2' COMMENT '1-read message,2-unread message', `ip_address` varchar(250) DEFAULT NULL COMMENT 'ip address' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `notification` -- ALTER TABLE `notification` ADD PRIMARY KEY (`pk_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `notification` -- ALTER TABLE `notification` MODIFY `pk_id` int(250) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
above notification table required read,unread status because particular user notification you fetch at that time know that this particular user notification is read or not, when notification read then change status of notification table
ip address is filed store ip address of created notification its generally used for notify information,
Hope that you understand how to create notification and how to store into database
Comments