Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE `gun_views` (
- `id` bigint(20) NOT NULL,
- `dates` date NOT NULL,
- `hits` bigint(20) DEFAULT NULL,
- `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
- --
- -- Indexes for dumped tables
- --
- --
- -- Indexes for table `gun_views`
- --
- ALTER TABLE `gun_views`
- ADD PRIMARY KEY (`id`),
- ADD UNIQUE KEY `dates` (`dates`);
- --
- -- AUTO_INCREMENT for dumped tables
- --
- --
- -- AUTO_INCREMENT for table `gun_views`
- --
- ALTER TABLE `gun_views`
- MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
- -------------------------------------------------------------
- insert into
- gun_views(dates, hits)
- values
- (date_format( now(),"%Y-%m-%d"),1)
- ON DUPLICATE KEY
- update
- hits = hits + 1;
- ---------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement