Author Topic: PHPmyDbInterface is a PHP class that does the function of ADODB class in MS ASP  (Read 19 times)

0 Members and 2 Guests are viewing this topic.

Software Santa

  • Administrator
  • *****
  • Posts: 4310
  • OS:
  • Mac OS X 10.9 Mac OS X 10.9
  • Browser:
  • Firefox 60.0 Firefox 60.0
PHPmyDbInterface is a FREEWARE PHP class that does the same exact function of the Proprietary ADODB class in Microsoft's ASP.

Quote
  What is PHPmyDbInterface?
PHP in my opinion is much more better than micro$oft ASP, not only because it's open source, C based, platform independent, can give a full freeware open source solution (PHP, mySQL, Apache, Linux) but also to the great database servers support in a native connection like mySQL, micro$oft SQL server, Oracle and many others beside the support of ODBC connections.

The main problem facing the database handling in PHP was always that you have to deal with each database in a different way than what you're dealing with another, so it was very difficult to divert from one database server to another without making major changes in your PHP code, that's why this project was made for.

PHPmyDbInterface is a PHP class (Freeware, open source, GPL License) that does the function of ADODB class in ASP, so you'll only change a config file and leaves the whole rest code untouched.

   Current Version
1.0 Alpha



   - Current Database servers supported:
1. ODBC Connections.
2. mySQL native Connection.
3. Micro$oft SQL Server native Connection.
4. Oracle Connection.


PHPmyDbInterface Configuration
(Note: all next steps will be in db.php file)

   1- Database Server connection type:
Change $this->dbCase value to the database server connection type you want to use as follows:
Code: [Select]
$this->dbCase = 1; //1=mySQL
$this->dbCase = 2; //2=ODBC
$this->dbCase = 3; //3=MS SQL Server
$this->dbCase = 4; //4=Oracle

   2- Database Configuration:
Here you'll put information to make the database connection.
Code: [Select]
$this->host = "HostName";
$this->user = "UserName";
$this->pass = "PassWord";
$this->dbName = "DbName";

   3- ODBC Case:
If you are using ODBC, then the $this->dbName can be left blank and you must(at that case) put $this->dns value .

Code: [Select]
$this->dns = "DNSName";
   4- Extensions Path:
Here you must define the path of the PHP extensions files relative to PHP.exe (By Default = extensions/)
Code: [Select]
$this->extenPath = "ExtensionsPath";

How to use PHPmyDbInterface


   1- Include PHPmyDbInterface Class file:
First you have to include the source file of the class as follows (assuming the db.php file is at the same working directory of yours):
Code: [Select]
<? include("db.php"); ?>
   2- Create instance of dbInt Object:
Second you have to create an instance of PHPmyDbInterface object instance as follows:
Code: [Select]
<? $db = new dbInt(); ?>
   3- Execute SQL Statement:
The executing of the SQL statement returns a record set exactly like the one of ASP ADODB.
Code: [Select]
<? $rs = $db->exeQue ("select * from tableName where whereCondition order by orderbyCondition"); ?>

   4- Using returning recordset:
Now you can use the recordset exactly like that of ADODB. You can call fields either by thier names or thier position, also you can call any row by its number.
Code: [Select]
<? $recNum = 0;
while(count($rs)>$recNum)
{ echo $rs[$recNum]['fieldName']."<BR>";
for ($i=0;$i<count($rs[$recNum]);$i++)
$rs[$recNum][$i]."<br/> "; $recNum++;} ?>


PHPmyDbInterface Limitations

As this is the first editions of PHPmyDbInterface, so there are some limitations that I'm working to overcome on the next period, if you suggest something please contact Me.

   1- Operating Systems:
For now PHPmyDbInterface supports windows platform for database servers that require external extensions like SQL Server and Oracle, I'm looking now forward to support Linux and Unix too.

   2- Database Servers:
For now 4 types of database connections are supported: ODBC,mySQL,SQL Server and Oracle, more and more are coming soon.



http://phpmydbint.sourceforge.net/index.html

https://sourceforge.net/projects/phpmydbint/

 


This Site was Opened on January 1st, 2007

Welcome Visitor:





@MEMBER OF PROJECT HONEY POT
Spam Harvester Protection Network
provided by Unspam



email