[eluser]Ricardo SDL[/eluser]
Hi fellows! I have a database script that generates my tables and other things in the database. It looks like:
Code:
drop table if exists users;
CREATE TABLE `users` (
`id` INT NOT NULL AUTO_INCREMENT ,
`register_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`user_name` VARCHAR(20) NOT NULL ,
`email` VARCHAR(100) ,
`password` VARCHAR(100) NOT NULL ,
PRIMARY KEY (`id`) ,
UNIQUE (
`user_name`
)
) ENGINE = InnoDB;
CREATE TABLE `categories` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` VARCHAR( 20 ) NOT NULL ,
`description` VARCHAR( 256 ) NULL ,
`language` VARCHAR( 5 ) NULL ,
`create_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE = InnoDB ;
I tried to load this script from a text file and execute it through $this->db->query() function.
I've got some errors, the script is fine (the part above is for illustration only). Can the codeigniter execute queries like this one or I must change the script?
I'm using mysql 5.0.67 and codeigniter 1.7.1.
Thanks in advance.