I found the solution:
function rating_install(){
//Funcion que genera la instalacion del plugin
global $wpdb;
$table_name = $wpdb->prefix."rating";
$create = "CRETA TABLE ".$table_name." ( "
. "id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY, "
. "url TINYTEXT NOT NULL, "
. "descripcion TINYTEXT NOT NULL ) ";
$wpdb->query($create);
/*require_once(ABSPATH."wp-admin/includes/upgrade.php");
dbDelta($create);*/
}
function rating_uninstall(){
//Funcion que genera la desinstalacion del plugin
global $wpdb;
$table_name = $wpdb->prefix."rating";
$drop = "DROP TABLE IF EXISTS ".$table_name;
$wpdb->query($drop);
/*require_once(ABSPATH."wp-admin/includes/upgrade.php");
dbDelta($drop);*/
}
I wrote wrong the create sentence and ussing $wpdb->query($create) works!
Thanks for all!
Related Posts:
- Install widget on plugin activation
- Is there any way to allow a plugin to write over a previous version?
- How to stop activation addon if the main plugin is not activated
- Plugin Install Issue “-1” Appended to end of plugin name
- Error Connecting to Database WHEN Installing WordPress on XAMPP [Tried All the Usual Stuff] (Pics Included)
- I can install my plugin in localhost but not in my server
- Get a path to a different plugin
- How to check uniqueness of plugin prefix?
- Plugin API for easy admin list table generation, handling & exporting of MySQL tables?
- Change default admin page for specific role(s)
- Check for dependent plugin and if false dont activate plugin
- How to check username/password without signing in the user
- Show message on wordpress admin dashboard
- Log in from one wordpress website to another wordpress website
- What’s the earliest point I can get the queried object ID?
- Custom admin_notices Messages Ignored During Redirects
- Add content to widget title in admin area within the widget?
- Is it save to require plugin.php early to be able to use get_plugin_data() earlier?
- When is it appropriate to put functions on page template vs. functions.php?
- How to use the settings API to set multidimensional arrays
- Unit Testing a Plugin functionality with cron
- How to enable users to down-vote in this simple voting counter (that uses the post meta)?
- Is it possible for a plugin to register a page template file?
- How to allow Unfiltered HTML in a wordpress multisite install
- Best way for plugin to accept POSTs?
- What are the really difference writing WordPress 3.x widget plugins?
- Error “Call to a member function switch_to_locale() on null” during insert_with_markers
- multiple functions with same filter
- Calling plugins API within a theme
- How do you output enqueued scripts to an admin page?
- Woocommerce – Hide a Column in Cart Table
- Does WordPress’s HTTP API use any caching?
- query users by role
- call_user_func_array() expects parameter 1 to be a valid callback, array must have exactly two members
- How to Create Custom HTML Tag on Editor in `Text(HTML)` mode
- null callback in add_settings_section
- Is there a Filter that I can use to filter the tags before they are inserted in to the database?
- How long should it take for a plugin to fully load into the WordPress.org plugin repository?
- Which directory in my plugin repo does WordPress Plugin Directory package?
- How can I pass get_the_author_meta(‘user_email’) through the REST API?
- get post attachment using ajax
- Replace default Blogroll Links with Social Media Links
- Append varible to url or set session
- How to enqueue or include json file to a plugin
- Search and Filter
- Trying to code a simple plugin, infinite loop?
- Update own Plugin Repository on Multisite
- Custom Plugin theme filter
- How to exit a plugin’s execution mid-stream?
- Issue with contextual help overwriting existing content
- Inserting code to HTML view from a pop up initiated from visual view
- CSS not affecting widget output
- Redeclaring a plugin function within a class
- Using a custom shortcode from within the template of a shortcode plugin
- enqueue script/style plungin development
- Trying to get class to instantiate ONCE (or, “why do I keep punching myself in the head?”)
- How to create a WordPress Plugin that has it’s own “page”?
- How to Add a Custom Size for Thumbnails for WP – Gallery
- Create Widget or Enable Shortcodes in Sidebar
- Will I get an error if I try unscheduling a WP Cron scheduled task that wasn’t scheduled?
- Conditional Generation of Image Sizes using add_image_size
- Plugins and caching
- WordPress publish_post hook not getting featured image and meta on first publish, but works on updating title
- Add function after the_content
- Display time difference (6 hours ago) in a Soliloquy caption
- How to add custom view links to wp-admin/post.php?
- Empty Array is Giving Warning for array_merge()
- how to create category with code in wordpress using form
- Get post thumbnail in WP_Query
- How To Protect Plugin Display From Being Affected By Theme’s CSS
- Is it possible to have instead mypage.com/?page_id=81 to have mypage.com/cool/?
- User Data Handling between two plugins
- Translations only load from `wp-content/languages/plugins` but not from the plugin’s languages folder
- Woocommerce place order update shipping price
- wp_schedule_event not executing function call, even with add_action
- GET request return value as error instead of success
- How to update global variables in plugin activation callback?
- How to query a nested field in wordpress api using _fields param
- function add custom fields to media gallery
- How to include a page template and template part into my plugin
- ajax response strips multidimensional array and unable to decode
- Multiple instances of $opt_name in redux framework
- Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework
- The Events Calendar featured image as body background?
- using wordpress acf shortcods in tables goes outside the table
- Pass javascript result to shortcode executer function
- Not able to Update database while creating a custom module
- How to load css file after a certain css file
- Plugins and how to assign urls to content
- Deactivate Other Incompatible Plugin Upon Activation
- Sessions in plugin development?
- admin page passing $_POST variables to itself
- Can wp_schedule_single_event be used to run background proccess?
- Is it possible to make WordPress as a RESTful app?
- Get user logged in status from within a plugin. $current_user not defined
- Widget plugin and input file
- How to inject html to every page with a plugin?
- Custom plugin not appearing
- Add a custom image source
- Plugin forms overwrite each other’s options