PHP Classes

MySQL MSSQL Connect: Execute queries on MySQL and Microsoft SQL queries

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 181 All time: 8,708 This week: 206Up
Version License PHP version Categories
mysqlmssqlconn 1.0The PHP License5PHP 5, Databases
Description 

Author

This is a simple class can that can execute queries on MySQL and Microsoft SQL queries.

It provides two separate classes that can connect respectively to a MySQL or a Microsoft SQL database server.

The classes also provide functions with the same names to execute database queries, retrieve then number of rows in the query results, and retrieve the query result records into an array.

In Spanish:

Estas dos sencillas Clases que permiten conectarse de igual manera a Servidores Mysql o servidores MS SQL SERVER.

Comparten la misma estrutura, funciones, solo se diferencían en dos cosas,en la instancia y la conectividad.

Picture of Milton de Jesús Flores Torres
Name: Milton de Jesús Flores ... <contact>
Classes: 1 package by
Country: Mexico Mexico

Example

<?php
include('ConexionMySQL_I.php');

$db = new mySQL; // Creamos la instancia del objeto mysql

$strSQL = "SELECT * FROM educators";
$result = $db->executeQuery($strSQL);

$educatorsN = getNumRows($result);

if(
$educatorsN > 0)
{
  while(
$row = $db->fetchArray($result))
  {
    echo
"Educador No. {$row[0]}, Nombre: {$row[1]}";
  }
// fin de while
}else{
   echo
"No hay educadores en la DB";
}

?>


// MS SQL SERVER


<?php
include('ConexionMSSQL.php');

$db = new msSQL; // Creamos la instancia del objeto MS SQL SERVER

$strSQL = "SELECT * FROM educators";
$result = $db->executeQuery($strSQL);

$educatorsN = getNumRows($result);

if(
$educatorsN > 0)
{
  while(
$row = $db->fetchArray($result))
  {
    echo
"Educador No. {$row[0]}, Nombre: {$row[1]}";
  }
// fin de while
}else{
   echo
"No hay educadores en la DB";
}

?>


  Files folder image Files (3)  
File Role Description
Plain text file ConexionMSSQL.php Class msSQL Class Connect
Plain text file ConexionMySQL_I.php Class mySQL Class Connecy
Accessible without login Plain text file ejemplos.php Example EJEMPLO / SAMPLE

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:181
This week:0
All time:8,708
This week:206Up
User Comments (1)
Still using mysqli.
5 years ago (Ken Turnbull)
15%Star