php - ADODB to PDO quick switch -


In the past, I use adodb for mysql in php. Now, I want to use the PDO. Is there any way that I can switch from ADODEB query to PW for a switch to switch to a database quickly?

"post-text" itemprop = "text">

You can test the following two examples:

  #PDO script: $ db = new PDO ("mysql: dbname = you_db_name; host = 127.0.0.1", "root", ""); $ $ = $ Db- & gt; Query ("Select * FROM Table") - & gt; Fetch All (PDO :: FETCH_ASSOC); Forex Currency ($ RS $ R) {} #ADOdb Script requires_once ("adodb5 / adodb.inc.php"); $ ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; $ Db = new payment ("mysql: // root: @ 127.0.0.1 / you_db_name"); $ $ = $ Db- & gt; Execute ("Select * Table from"); Foreach (as $ rs $ r) {}  

Note that the PDO is a native compiled library and does not load at runtime.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -