Skip to main content
typos
Source Link
Bainternet
  • 67.8k
  • 8
  • 132
  • 188

Well, I finished my first plugin in wordpress buyWordPress but I have a little problem.

My plugin have the next code

add_action('my-plugin/my-plugin.php','rating_install'); add_action('admin_menu','rating_add_option'); function rating_install(){ 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); } function rating_uninstall(){ global $wpdb; $table_name = $wpdb->prefix."rating"; $drop = "DROP TABLE IF EXISTS ".$table_name; $wpdb->query($drop); } add_action('activa_rating/my-plugin.php','rating_install'); add_action('desactiva_rating/my-plugin.php','rating_uninstall'); 

And it's works in localhostslocalhost when I active my plugin, but when I upload the plugin to my server this code isn't work, like it's doesn't exists. Don't create my table in the database.

I'm see the privilege in the database and I've all the privileges.

Well, I finished my first plugin in wordpress buy I have a little problem.

My plugin have the next code

add_action('my-plugin/my-plugin.php','rating_install'); add_action('admin_menu','rating_add_option'); function rating_install(){ 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); } function rating_uninstall(){ global $wpdb; $table_name = $wpdb->prefix."rating"; $drop = "DROP TABLE IF EXISTS ".$table_name; $wpdb->query($drop); } add_action('activa_rating/my-plugin.php','rating_install'); add_action('desactiva_rating/my-plugin.php','rating_uninstall'); 

And it's works in localhosts when I active my plugin, but when I upload the plugin to my server this code isn't work, like it's doesn't exists. Don't create my table in the database.

I'm see the privilege in the database and I've all the privileges.

Well, I finished my first plugin in WordPress but I have a little problem.

My plugin have the next code

add_action('my-plugin/my-plugin.php','rating_install'); add_action('admin_menu','rating_add_option'); function rating_install(){ 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); } function rating_uninstall(){ global $wpdb; $table_name = $wpdb->prefix."rating"; $drop = "DROP TABLE IF EXISTS ".$table_name; $wpdb->query($drop); } add_action('activa_rating/my-plugin.php','rating_install'); add_action('desactiva_rating/my-plugin.php','rating_uninstall'); 

And it's works in localhost when I active my plugin, but when I upload the plugin to my server this code isn't work, like it's doesn't exists. Don't create my table in the database.

I'm see the privilege in the database and I've all the privileges.

Source Link
Marcos
  • 187
  • 2
  • 12

I can install my plugin in localhost but not in my server

Well, I finished my first plugin in wordpress buy I have a little problem.

My plugin have the next code

add_action('my-plugin/my-plugin.php','rating_install'); add_action('admin_menu','rating_add_option'); function rating_install(){ 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); } function rating_uninstall(){ global $wpdb; $table_name = $wpdb->prefix."rating"; $drop = "DROP TABLE IF EXISTS ".$table_name; $wpdb->query($drop); } add_action('activa_rating/my-plugin.php','rating_install'); add_action('desactiva_rating/my-plugin.php','rating_uninstall'); 

And it's works in localhosts when I active my plugin, but when I upload the plugin to my server this code isn't work, like it's doesn't exists. Don't create my table in the database.

I'm see the privilege in the database and I've all the privileges.