Location: PHPKode > projects > RadhikaGB > radhikagb_f2505100832/admin/sql.php
<?php
//||_____________________RadhikaGB_____________________||//
//||---------------------------------------------------||//
//||Page ID  :  sql.php(ADMIN)                         ||//
//||Build ID :  2505100832                             ||//
//||Support  :  http://softacme.com/radhikagb          ||//
//||          Jai Shri RADHA RANI...                   ||//
//||---------------------------------------------------||//
?>
<?php
class dumper {
var $database;
		function dumper($db=null){
		return $this->sdb($db);
		}
		function sdb($db){
		$this->database = $db;
		return true;
		}
		function gdbs(){
		return $this->database;
		}
		function Structure(){
		if ( !(@mysql_select_db($this->database)) ){
		return false;
		}
		$reco = @mysql_list_tables($this->database);
		while ( $record = @mysql_fetch_row($reco) ) {
		$table = $record[0];
			$structure .= "-- \n";
			$structure .= "-- Table structure for table `{$table}` \n";
			$structure .= "-- \n\n";
			$structure .= "DROP TABLE IF EXISTS `{$table}`; \n";
			$tableStructure = @mysql_fetch_assoc(@mysql_query("SHOW CREATE TABLE $table"));
			$structure .= $tableStructure['Create Table'];
			$structure .= ";\n\n\n";
			}
			return "SET FOREIGN_KEY_CHECKS = 0;\n\n".$structure."SET FOREIGN_KEY_CHECKS = 1;\n\n";
			}
			function gdt(){
				if ( !(@mysql_select_db($this->database)) ){
					return false;
															}
				$reco = @mysql_list_tables($this->database);
					while ( $record = @mysql_fetch_row($reco) ) {
					$table = $record[0];
					$data .= "-- \n";
				$data .= "-- Dumping data for table `$table` \n";
				$data .= "-- \n\n";
					$reco1 = mysql_query("SELECT * FROM `$table`");
					while ( $rec1 = @mysql_fetch_assoc($reco1) ){
					unset($tmpd);
					$data .= "INSERT INTO `$table` VALUES (";
					foreach ( $rec1 as $key => $value ){
					$tmpd .= ( !isset($rec1[$key]) ) ? 'NULL' : "'".addslashes($value)."'";
					$tmpd .= ', ';
					}
					$tmpd = substr($tmpd,0,-2);
					$data .= $tmpd.");\n";
					}
					$data .= "\n\n";
					}
					return "SET FOREIGN_KEY_CHECKS = 0;\n\n".$data."SET FOREIGN_KEY_CHECKS = 1;\n\n";
					}	
					//finally we get the data all include here
			function newdump() {
		if ( !(@mysql_select_db($this->database)) ){
			return false;
		}
		return $this->Structure().$this->gdt();
	}
}
?>
Return current item: RadhikaGB