Phalcon Tutorial
Phalcon Useful Resources
Selected Reading
- Phalcon - Security Features
- Phalcon - Object Document Mapper
- Phalcon - Working with Forms
- Phalcon - Asset Management
- Phalcon - Multi-Lingual Support
- Phalcon - Session Management
- Phalcon - Cookie Management
- Phalcon - Database Migration
- Phalcon - Query Language
- Phalcon - Scaffolding Application
- Phalcon - Switching Databases
- Phalcon - Database Connectivity
- Phalcon - Routing
- Phalcon - Views
- Phalcon - Models
- Phalcon - Controllers
- Phalcon - Configuration
- Phalcon - Functionality
- Phalcon - Application Structure
- Phalcon - Environmental Setup
- Phalcon - Overview
- Phalcon - Home
Phalcon Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Phalcon - Switching Databases
Phalcon - Switching Databases
We have used a MySQL database in our apppcation. If we wanted to change the database software midstream, it would not be too hard, as long as we have the same data structure in our new database.
PostgreSQL
Configure the web apppcation which will connect to PostgreSQL database.
This can be achieved using the following code. The services will include PhalconDbAdapterPdoPostgresql
use PhalconDbAdapterPdoPostgresql; $config = [ host => localhost , dbname => blog_tutorial , port => 5432, username => root , password => ]; $connection = new Postgresql($config);
SQLite
For implementing SQLite connection, the configuration should be extended with PhalconDbAdapterPdoSqpte abstract class.
<?php use PhalconDbAdapterPdoSqpte; $connection = new Sqpte([ dbname => /tmp/blog_tutorial.sqpte ]);
Oracle
For implementing Oracle database connection in Phalcon, the configuration should be extended with PhalconDbAdapterPdoOracle abstract class.
<?php use PhalconDbAdapterPdoOracle; $config = array ( "dbname" => "//localhost/blog_tutorial", "username" => "root", "password" => "" ); $connection = new PhalconDbAdapterPdoOracle($config);Advertisements