Saturday, October 25, 2014

How to check if there is a database (cakephp 2.5.5)

Hi, 

I create the form and component script to save the database configuration file. 
There, in a form have select field with options that allow the end user to select what they want to use (mysql, postgres, ..) 

This works well, if I select mysql, but if I put another option I have a fatal error, because I do not have that database. 

Now I want to check whether the application connect to this database before we saving options in database.php, 

If the user has selected eg "Database / Postgres" to show him the error and returns it to the form, because the application can not connect. 


Please some guidance. 

thank you

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: