Login   Register  
PHP Classes
elePHPant
Icontem

File: top_script.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Panos Kyriakakis  >  AJAXed list boxes  >  top_script.php  >  Download  
File: top_script.php
Role: Auxiliary script
Content type: text/plain
Description: Example file
Class: AJAXed list boxes
Generate AJAXed linked select inputs
Author: By
Last change: configuration moved here and a help db function.
Date: 2007-09-24 06:49
Size: 1,016 bytes
 

Contents

Class file image Download
<?php

    
/*
        LSB demo script.
        
        Just for demonstration purposes, it is suposed to use 
        your script's current db connection.
     */

    
openDB(    'localhost',    // server
            
'salix',        // database name
            
'salix',        // db username
            
'salix'         // db password
          
); 

    function 
openDB$dbserver_name$database_name$dbserver_username$dbserver_password) {
    
        
$resp=0;
        
        
$link = @mysql_connect($dbserver_name$dbserver_username$dbserver_password);
        if(
$link!=false) {
              
$resp = @mysql_select_db($database_name);
              if (
$resp != false) {
                  
$resp=0;
              }
              else {
                
$resp = -1;
              }
        }
        else {
              
$resp = -2;
        }
        if( 
$resp!=) {
            if( isset(
$link) )
                unset(
$link);
        }
        return( 
$resp );
    }   
// end function openDB ----------------------------------


?>