PHP Classes

File: ejemplos.php

Recommend this page to a friend!
  Classes of Milton de Jesús Flores Torres  >  MySQL MSSQL Connect  >  ejemplos.php  >  Download  
File: ejemplos.php
Role: Example script
Content type: text/plain
Description: EJEMPLO / SAMPLE
Class: MySQL MSSQL Connect
Execute queries on MySQL and Microsoft SQL queries
Author: By
Last change:
Date: 2 years ago
Size: 878 bytes
 

Contents

Class file image Download
<?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";
}

?>

For more information send a message to info at phpclasses dot org.