Problem in creating table through plugin code

I’m using the following code to create the database table using plugin. However, the table is neither getting created nor I’m getting any error message. The code is as follows: global $wpdb; $table_name = “tbllb_club”; $sql = “create table $table_name ( club_id int(11) NOT NULL auto_increment, project_name varchar(500) NOT NULL, first_name varchar(100) NOT NULL, school_status … Read more

wpdb->get_row() / get_results – is it possible to return an object instances of my own class?

Is it possible to make wpdb->get_row return an object of a my own custom class instead of stdClass? 2 Answers 2 Doesn’t look like it’s possible, at least there doesn’t seem to be an elegant way. get_row() invokes query(), which uses mysql_fetch_object() with a single parameter, ie it’s not possible to pass anything to its … Read more

$wpdb->insert inserting two rows in database

Hi i am trying to insert data in database but $wpdb->insert insert two rows. my code for insert data is global $wpdb; $tablename = $wpdb->prefix . ‘<TABLE NAME>’; for ($i = 0; $i < sizeof($emails); $i++) { $data = array(“post_id” => $post_id, “user_id” => $user_id, “email” => $emails[$i], “status” => 1 ); $wpdb->insert($tablename, $data); } … Read more

Error connecting to DB in /wp-includes/wp-db.php on line 1538 [closed]

Closed. This question is off-topic. It is not currently accepting answers. Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question? Closed 5 years ago. Improve this question new in wordpress world. My wordpress … Read more