13 in a dozen db class: Access MySQL servers and display queries in tables

Recommend this page to a friend!
  Info   View files (3)   Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
51%Total: 4,045 All time: 765 This week: 248
Version License Categories
dozen13 1.0.0Freely DistributableHTML, Databases
Description Author

This class can be used to access MySQL database servers and display query results in HTML tables.

It can establish database connections to a given MySQL host, retrieve server database information, execute SQL queries, retrieve the inserted identifier by the last INSERT query, get the number of effected rows by a query, get the number of returned rows by a query, get the number of columns in a query result set, retrieve query result rows into arrays or objects.

The class can also generate HTML tables to display query result data or metadata about the query result columns.

Picture of joris visser
Name: joris visser <contact>
Classes: 1 package by
Country: The Netherlands The Netherlands
Age: ???
All time rank: 74921 in The Netherlands The Netherlands
Week rank: 762 19 in The Netherlands The Netherlands

Details
13-IN-A-DOZEN DATABASE

YES YET AN OTHER DATABASE CLASS

CREATOR: JORIS VISSER

MY FIRST SELF WRITEN CLASS

=-=-=-=-=-=-=
tested under 
PHP 5.1.2
PHP 4.3.6

====
manual

	var $db_HOST = "localhost";
	var $db_USER = "root";
	var $db_PASS = "root";
	var $database = "db"; 
	var $sqlerror = "sql could not be connected"; 
	var $dbc ;

=-=-=-=-=-=-=
normal usage:
<?php
include("db.class.php");
$db = NEW database;
?>
- assigning database class
-- connection to database


=-=-=-=-=-=-=
database()
- standard call
-- connection to database


=-=-=-=-=-=-=
connect_db()
- connect to database


=-=-=-=-=-=-=
query_db($query,$print = false) 
//1. query 
//2. show query (optional)
- preform query
-- show error if could not be executed
- check if query was given
-- show query when $print is given as true


=-=-=-=-=-=-=
close_db()
- close database connection


=-=-=-=-=-=-=
id_db()
- return last given inserted ID


=-=-=-=-=-=-=
affecte_db() 
- return affected rows in db


=-=-=-=-=-=-=
num_rows($q)
1. query
- return number of rows in query

=-=-=-=-=-=-=
num_fields($q)
1. query
- return number of fields from query

=-=-=-=-=-=-=
db_info()
=-=-=-=-=-=-=
fetch_db_row($fetched)
1. result from $db->query_db($query)
- return as mysql_fetch_row

=-=-=-=-=-=-=
fetch_db_array($fetched)
1. result from $db->query_db($query)
- return as mysql_fetch_array

=-=-=-=-=-=-=
fetch_db_assoc($fetched)
1. result from $db->query_db($query)
- return as mysql_fetch_assoc

=-=-=-=-=-=-=
fetch_db_object($fetched)
1. result from $db->query_db($query)
- return as mysql_fetch_object

=-=-=-=-=-=-=
get_table($query,$names='',$url='',$extrafields='')
1. query
2. names for table headers (optional)
3. Give url in field (optional)
4. Extrafields additional to rest of query (optional)
- preform query
-- give error
- makeup given $_GET variables for sorting
- give query back in table form
-- makeup of table can be changed in class.inc.css

Makeup 100% W3C xhtml compatible!

=-=-=-=-=-=-=

  Files  
File Role Description
CSS Data CSS
README Doc. README
13inadozendbclass Class Class rep..

 Version Control Unique User Downloads Download Rankings  
 0%
Total:4,045
This week:0
All time:765
This week:248
 User Ratings  
 
 All time
Utility:75%
Consistency:81%
Documentation:62%
Examples:-
Tests:-
Videos:-
Overall:51%
Rank:2193
  

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