Login   Register  
PHP Classes
elePHPant
Icontem

File: mysql_class.readme

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Fernando André  >  mysql_class  >  mysql_class.readme  >  Download  
File: mysql_class.readme
Role: Documentation
Content type: text/plain
Description: English
Class: mysql_class
Easier insert, update methods with MySQL
Author: By
Last change: Corrected , adapted and added a few examples;
Date: 10 years ago
Size: 1,859 bytes
 

Contents

Class file image Download
The intention of this class is to simplify the mysql ,
queries and acess do database.
	
 What is Relevant in this class :
 It can be read from any location ( file.conf , url )
 the host,user,password directives.
 
 If you don't like this you can use a require of a php file
 that olds the confs .
 Or replacement of code by placing require($file) instead of file($file).
 And then assining the variables to the class variables.
 example ($this->database=$database;)
 
 You can also create the object like :
 require("mysql_class.php"); /* requiring the class file at the begining of a new class .*/
 $obj = new bd();
 $obj->ligarBD(Arguments);
 
 ligarBD is the same has connectBD

	
 You can use an easy funtion to insert or update values similar to 
 pg_insert, and pg_update available from Postgresql functions in PHP.
	
 The function are mysql_update(), mysql_insert();
	
 Every result of the query's to the database are returned has an object.

	Has for returning values you can use execSQL($sql)
	this will return data has an object.
        example($var->field;)
        
        Execution of querys that we do not which to see the
        return can be made using exec($sql).
        
        This class can also read configuration from a file :
        Configuration envolving ( server , host , user , password )

        " $this->confile = "db.conf"; "
        
Version 1.1
Release a few new features keeping the old ones.
Short description:

This is a improvement (i think) from the previous class, now this class new version can .
list all fields to an html table from a given sql table using listtable("table"); 
builds a form from  table fields using buildform("table"); 
Now mysql_insert returns the maximum id in table on query success.  
Implements a small html class just to build the form.