[eluser]lifegiver36[/eluser]
Hi all,
I have a problem which I don't know if there is an easy solution for since I am pretty new to codeIgniter. I am using the dbforge class to create tables in my database. Here is the code i have:
$test = $this->dbforge->create_table('testTable',TRUE);
if ($test) {
echo "database table created";
} else {
echo "database table creation failed";
}
The problem is that if I run this script multiple times, it keeps coming back as TRUE. So no matter what, each time the if statement runs it echo's out "database table created", even though it did not actually create the table because add the "IF NOT EXISTS" clause by making the second parameter TRUE in the create_table method.
To be clear though, this script does create the table the first time I run it. It's just that for some reason the $test variable keeps holding a true value even though no table gets created if I run that script multiple times. I figured the $test variable should hold a false value since the create_table method is not actually creating a table after the first time I run the script.
Anyone have any idea what I am doing wrong?