problems with Database Forge class - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: problems with Database Forge class (/showthread.php?tid=6261) |
problems with Database Forge class - El Forum - 02-20-2008 [eluser]chejnik[/eluser] Hello, I have problems with Database Forge class. I call this function in my model view called Creation_model Code: function create_DB() There comes the error. In log file (level 2) DEBUG - 2008-02-20 16:50:22 --> Model Class Initialized DEBUG - 2008-02-20 16:50:22 --> Creation model started DEBUG - 2008-02-20 16:50:22 --> Database Forge Class Initialized ERROR - 2008-02-20 16:50:22 --> Severity: Notice --> Undefined property: Creation_model::$dbforge /var/www/apache2-default/codeIgniter/system/application/models/creation_model.php 332 Thanks for any help. With regards Ales problems with Database Forge class - El Forum - 02-20-2008 [eluser]chejnik[/eluser] Hello again, I am suprised but it is solved now. To access Database Forge class one has to load Database Utility class instead. Code: function create_DB() In log file DEBUG - 2008-02-20 20:24:10 --> Creation model started DEBUG - 2008-02-20 20:24:10 --> Database Forge Class Initialized DEBUG - 2008-02-20 20:24:10 --> Database Utility Class Initialized DEBUG - 2008-02-20 20:24:10 --> Create Database started Is it kind of bug or it is common behaviour of Database Forge class? Thanks Ales problems with Database Forge class - El Forum - 02-23-2008 [eluser]chejnik[/eluser] Yet another question. I would like to create table using Forge class using mysql database driver Code: function create_Structure_User($tableName) The result of print_r Array ( [nickname] => Array ( [type] => VARCHAR [constraint] => 40 ) [password] => Array ( [type] => VARCHAR [constraint] => 40 ) [realName] => Array ( [type] => VARCHAR [constraint] => 40 ) [email] => Array ( [type] => VARCHAR [constraint] => 40 ) [street] => Array ( [type] => VARCHAR [constraint] => 40 ) [psc] => Array ( [type] => VARCHAR [constraint] => 40 ) [town] => Array ( [type] => VARCHAR [constraint] => 40 ) [country] => Array ( [type] => VARCHAR [constraint] => 40 ) [timezone] => Array ( [type] => VARCHAR [constraint] => 40 ) [phone] => Array ( [type] => VARCHAR [constraint] => 40 ) [alternativePhone] => Array ( [type] => VARCHAR [constraint] => 40 ) [msn] => Array ( [type] => VARCHAR [constraint] => 40 ) [icq] => Array ( [type] => VARCHAR [constraint] => 40 ) [alternativeEmail] => Array ( [type] => VARCHAR [constraint] => 40 ) [web] => Array ( [type] => VARCHAR [constraint] => 40 ) [notes] => Array ( [type] => TEXT ) ) An Error Was Encountered Error Number: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' `nameRealProject` VARCHAR(100), `nicknameAdmin` VARCHAR(40), `passwordAdmin`' at line 2 CREATE TABLE IF NOT EXISTS Project ( Array, `nameRealProject` VARCHAR(100), `nicknameAdmin` VARCHAR(40), `passwordAdmin` VARCHAR(40), `passwordProject` VARCHAR(40), `emailAdmin` VARCHAR(40), PRIMARY KEY (`id`) ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; Please note the in sql statement at the beginning the word Array - I have no idea how to put it away. Seems to come from mysql.forge.php. problems with Database Forge class - El Forum - 02-23-2008 [eluser]chejnik[/eluser] Hi, problems seems to be in Forge class itself When I comment a lot of lines it works Code: // -------------------------------------------------------------------- I leave only if (is_array($field)) condition. Ales |