JonLambell
Forum Replies Created
-
Forum: Plugins
In reply to: Problems with register_activation_hookI can’t believe that no one knows how to solve this problem.
With the amount of people who frequent this place.I’ve found a couple of threads with similar problems, none of the solutions work but must are also unanswered threads. What’s with the lack of support with WordPress?
Forum: Plugins
In reply to: Creating a plugin; create table on activationDid you ever get this sorted? I’m stuck with the exact same problem and responses around here just don’t seem to be happening, so I’m guessing it’s some kind of bug that people don’t know how to fix.
Forum: Plugins
In reply to: Problems with register_activation_hookTried changing to this
global $wpdb; $tableName = $wpdb->prefix . 'tweets'; $twitterUserName = "jonlambell"; $tweetLimit = 5; function tweet_install() { global $wpdb; global $tableName; $sql = "DROP TABLE IF EXISTS " . $tableName . "; CREATE TABLE " . $tableName . " ( id bigint(255) NOT NULL, name varchar(255) NOT NULL, img varchar(255) NOT NULL, msg varchar(255) NOT NULL, time varchar(255) NOT NULL, PRIMARY KEY (id) );"; $wpdb->query($sql); $wpdb->show_errors(); } register_activation_hook(__FILE__,'tweet_install');
Still it doesn’t add the table to the db. I’ve tried all sorts now and it’s doing my head in. It just refuses to add the table!
Forum: Plugins
In reply to: Problems with register_activation_hookNo one know anything about this then? Surely I’ve either done something slightly wrong here which I can’t spot or I’m missing something.
Forum: Plugins
In reply to: Problems with register_activation_hookI’ve tried putting this at the top and at the bottom of my page and it still refuses to add the table.
I’ve also tried using ‘backticks’ around the field names to no effect.