create table in wordpress plugin
<?php
function table_create()
{
global $wpdb;
$table_name = $wpdb->prefix . "wpactable";
$charset_collate = $wpdb->get_charset_collate();
$sql = "CREATE TABLE IF NOT EXISTS $table_name (
id mediumint(9) NOT NULL AUTO_INCREMENT,
name tinytext NOT NULL,
email tinytext NOT NULL,
number tinytext NOT NULL,
Website text NOT NULL,
PRIMARY KEY (id)
) $charset_collate";
require_once( ABSPATH .'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
}
?>function myplugin_update_db_check() {
global $jal_db_version;
if ( get_site_option( 'jal_db_version' ) != $jal_db_version ) {
jal_install();
}
}
add_action( 'plugins_loaded', 'myplugin_update_db_check' );
Also in PHP:
- carbon date from format
- db::statement in laravel
- date time format 12 hour am pm php
- date simple php
- check datatype php
- find string length php
- curl in php
- 71 - Specified key was too long; max key length is 767 bytes
- find characters in word php
- - phpunit/phpunit[8.5.0, ..., 8.5.x-dev] require ext-dom * ->
- eliminar ultimo caracter string php
- filteredduplicata php
- elevated th in dates format php
- bootswatch import theme into laravell vuejs
- catch exception php
- can we find like directorries in php
- current date timestamp in php
- check strinh in php
- SQLSTATE[42000]: Syntax error or access violation: 1071 laravel
- count string char php
- date to string php
- command working in terminal but working from code php
- Syntax error or access violation: 1071 Specified key was too long; max key length is 1000
- call php script output browser console