PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of steffan   SQL wrapper   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example to use sql.php
Class: SQL wrapper
Simple MySQL wrapper class
Author: By
Last change: errors
Date: 20 years ago
Size: 813 bytes
 

Contents

Class file image Download
<?php

error_reporting
(E_ALL);
include (
"classes/sql.php");

function
check()
{
   
$sql = new mn_mysql();

   

   
$sql->dbase = "db_name";
   
$sql->host = "db_host";
   
$sql->user = "db_user";
   
$sql->passwd = "db_user_pass";

   
$sql_result = "";

   
$pri = "";
   
$user = $_POST['user'];
   
$passwd = $_POST['passwd'];

   
   if(
$sql->connect())
    {
       
$sql_result = $sql->query("SELECT * FROM login ORDER BY idx");
    }else
    {
      die(
"error: " . mysql_error());
    }


/*
additional there is some more missing. but ur fantasy is given an open end :)
i just wanted to show in this example how to use the class in php files.

for my example i used a root directory and a 'classes' directory in it.
hope my example could help anyone :)
*/

?>