The problem I have with my solution, but I guess it's the same of the
one of the link, is that if I use it inside a controller, I get an error
before even reaching that code, due to a missing table... is there a way
to avoid this?
Of course I need this check for an installation page, which I'm
developing using a controller...
thanks in advance
Lorenzo
Miles J wrote:
You can try this, then see if your table exists within the array.
http://www.milesj.me/blog/read/75/Retrieving-Tables-Within-Your-Cake-Database
On Feb 1, 8:27 am, Lorenzo Bettini <[email protected]> wrote:
Hi
is this a correct way of checking whether a table exists?
function check_table_exists($table) {
$dbo = $this->getDataSource();
$result = $dbo->_execute('DESCRIBE '.$table);
return !empty($result);
}
thanks in advance
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en