You create auto column sno int(10) NOT NULL AUTO_INCREMENT,
and forget to define it as key, add PRIMARY KEY (sno)
to your sql.
$sql = "CREATE TABLE $table_name (
sno int(10) NOT NULL AUTO_INCREMENT,
postid int(50) NOT NULL,
subpostid varchar(5) NOT NULL,
votingcount varchar(50) NOT NULL,
postclicktime timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (sno)
) $charset_collate;";
If still won’t work, try replace postclicktime timestamp(5)
with postclicktime timestamp
.
Before MySQL 5.6, MySQL did not support fractional seconds stored as part of a TIMESTAMP datatype.
Related Posts:
- Delete tables from database when deleting plugin
- How to delete all records from or empty a custom database table?
- What is right way to go about adding functionality to a published WordPress plugin?
- Using Vagrant for customizable WordPress Multi-sites [closed]
- WordPress Plugin as ‘Library’ From Abstract Application?
- Custom comment type maybe?
- Add custom meta box on Post page
- Posts wont expire
- Custom Widget Creating PHP Exception When Placed In Its Own PHP File
- How to set value/term of a Woocommerce attribute text field in admin panel?
- WordPress Plugin development Call to undefined function jQuery()
- Conditional Display of Links in Widgets
- Created Widget Not Showing up on Admin Panel
- plugin for wp_list_categories with posts
- How to get last_updated and newest_blogs in WP 3.0
- Replace existing pages with new pages, keep menu links
- Recommendations for books/resource to get started with wordpress 3 development (plugins/themes) [closed]
- Will Flutter work with WordPress 3.0?
- Check if User exists in WordPress Multisite
- Override the filter from plugin in child theme
- Custom plugins/Manipulated plugins: Always a terrible idea to inherit these types of WP sites that discourage updates? [closed]
- Can a plugin deactivate and delete itself once installed and activated?
- How to modify shortcode attributes with data from current post
- How can I capture Memberpress user info after signup [closed]
- JS Support Ticket – Auto create WP account
- Removing customise fields during plugin uninstallation
- How to Create a Custom Panel and Fields in Post Page [Plugin]
- Anonymous Postings
- Run plugins only on certain pages
- wp_generate_attachment_metadata is creating an empty array
- Post category with counts been display like a menu
- Post custom Data value in The Events Calendar plugin [closed]
- Best way to maintain and update 3rd-party WP plugin when developer is unresponsive?
- Best place for short bio,image and button [closed]
- Use of Templates in a Plugin
- Custom wordpress Theme and Plugin repository
- Automatic Updates Individual Plugins Not Working
- WordPress as web application base
- URL rewrite of independent plugin?
- Plugin for users to create their own ads like Google Adsence
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- Custom widget doesn’t save values from dropdown box
- Plugin function inside custom plugin
- WordPress as template engine
- Change the style of h1, h2, only in post entry
- Custom API plugin to execute 3rd party API to retrieve data
- WordPress – source link plugin – how to modify it?
- Minimize and Uglify WordPress Plugin Files
- Customize Menu | Styling LESS/SCSS code formats
- Why is it important to check for isset and is_array before checking in_array in this example?
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- How Should Custom Functions Be Called For Single Posts?
- same user role or copy the user role to be same as the other role
- Want to modify a Plugin – Tweetily – Can I make it tweet a Custom Field instead of Post Title?
- How display specific category post to specific users?
- How can I replace content on site generated from plugin without changing plugin
- Download counter for skydrive shared files in wordpress
- Edit post image attributes on fly?
- How to keep plugin (media-sync) running even the tab is closed?
- Elementor: How to design Dropdown Select Box Navigation page like Chegg
- How to access a wordpress plugin page or add posts without doing it from the WordPress dashboard?
- Replace only the first CSS class
- Ultimate Members Default Post Layout problem
- How to assign a specific service to a specific provider based on location
- Move plugin pages from dashboard to front-end
- Creating custom “player-objects”
- save short-code in my custom plugin settings problem missed something
- Installation failed, trying to install ANY plugin
- Echo custom admin field into a is_single()
- Manual Backup – How to save to Firefox or Chrome (instead of IE which brings up popup I can’t get rid of)
- How can I save cookies to members
- Overwrite user role
- Place content inside the Post Loop
- Am I using an action hook correctly?
- Should I paste CDN links in a JS file or use a Bootstrap CDN plugin?
- Conditional required fields for WordPress Contact Form 7
- Problem with Duplicate Meta / tag description in Webmaster Tool [duplicate]
- Replace code in plugin template
- Style WordPress Custom Post Type Single Page
- Display_rows() and column_cb() strange behaviour
- Directory structure for plugin changes
- How can I pass value to function in add_menu_page?
- disable lightbox in a plugin [closed]
- Pull Data from DB for Admin Page Display as Relates to Admin Page Class by BA Internet
- show Visual form builder in the front end
- Need Help Creating a Multi-Step, Video-Guided Enrollment Site
- User specific content (posts) / limiting visibility
- Remove the ‘Press This’ Tool
- Making a particular kind of search engine with WordPress?
- How wordpress plugin hooks works? [duplicate]
- Selling Downloadable Products [closed]
- How to delete remain data in WP database after deleting custom post via admin interface
- AdBlock blocks my non-advertising sidebar images [closed]
- How can I modify the colors of my theme for a single section of my site? [closed]
- How to generate a responsive output from plugin?
- Need help saving input fields for Security Deposit plugin in WC Vendors page
- WordPress Customise
- Looking for membership style plugin with edit option [closed]
- Create Custom Coupon Type
- Using ACF to allow user to add and edit multiple saved forms