mardi 5 mai 2015

MySQLi Equivalent Of MySQL Code

Can you give me the equivalent of this code im MySQLi? Can't get it right.

public function showTable($table) {
    if (mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . DB_PREFIX . $table . "'"))) {
        return TRUE;
    } else {
        return FALSE;
    }
}

public function createTable() {
    $sql = "CREATE TABLE `" . DB_PREFIX . "category_related` (`category_id` INT(11) NOT NULL,   `rcategory_id` INT(11) NOT NULL, PRIMARY KEY (`category_id`, `rcategory_id`))";
    $this->db->query($sql);
}

Aucun commentaire:

Enregistrer un commentaire