+62 8565991 7218 support@resellermarketglory.com

Thursday, July 29, 2010

DB 2 SQL code

12:29 PM

Share it Please
A PHP file that connects to a specified host and mySQL database, and generates the SQL queries needed to reconstruct the database. Very useful if you want to back up a database over the web, or simply to transfer a mySQL database to your local machine.
Features/Options:
-backup either structure, data, both or just test connection
-backup only specified tables or all
-view all databases
-suports multi-column keys, all field types, autoinc fields, etc.
-escapes all field data
-saves as db_name.sql
-fully functionalised to allow for easy customisation

download PHP Source in here

Screenshot:
DB2SQL screenshot
Generated SQL Sample:
#    db2SQL v1.04 - www.puremango.co.uk
#---------------------------------------------
# Dump of Host: [localhost:3306]
#           DB: [puremang_mango]
#    Generated: August 5th, 2005, 6:18:25 am
#---------------------------------------------
 
#
# Structure of table [test_table]
#
CREATE TABLE IF NOT EXISTS test_table (
 
  id int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
  date varchar(20) ,
  page varchar(255) ,
  remote_addr varchar(15) ,
  note varchar(255) ,
  PRIMARY KEY (id),
  UNIQUE KEY id (id),
   KEY id_2 (id)
);
 
#
# Data for [test_table]
#
INSERT INTO test_table VALUES(1,"20-03-05","index.php","192.168.254.254","");
INSERT INTO test_table VALUES(2,"20-03-05","about.php","192.168.254.254","");

0 komentar:

Post a Comment