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v6 |4о42bU3k %'}Gp9X}mNH.Ih<<>dS]Jdy!ZHC_g ʫYxY%Pss4`ǧ* n֢KjrSb1>]m S66G;zǐI [5uv"٢9p"˽W?4YlvVjgSlOl'SX3[eJnW nûzoLda=V§NDw !!Z`r:KH 9Ī@g`F!-*_0+=uCϐ{Vqhg9kLIĈPj/_)8_0.Y.4:KH 9Ī@g`F978fҠTW:<lN_=`\Y@JG7&HoZ3 \1gsW!fɴUίKt[\ &]4> YLTZBv'lK!m&#sG|0:KH 9Ī@g`F978fҠ~SJ0cK2}%Rze%t-C.ױ:KH 9Ī@g`F:KH 9Ī@g`F&+!zxPh9 #ɹ?a ?ӹ-5TQEdL.R׉ܯ |lIWcҢѦ5²|ƑG ۍ2_iQsZ BrLp9= *c6Oפ-9ifé;Rd,[EߠY |TB&MR+P\V5s2].lߴ oZǎ쏣){8A5˿/7%%"[ˠ8eW2 u+_M)7۾&$p?w(e1+!P}̈m0RoA S11&\)/5\(GH ֨H4 y}wx;Id-EQRZٗpOMq#;QR䙚+M]o+)eL 4䂘ctL =9TQMg]W6r0DyZ?-E);]n=ǀ_&? ɭu^"Qč+/ƤVS 9^#) l G˲{,W{*HME:.1Bcx]6V#:Ϟou\>mŤ8t)'l$ŒMduVe)Onj9 XB--܋dhBn.={5OuT'vs$ dg |*~O塳 LkV=:ct_db($db); if(!$conn || !$condb){ echo mysql_error(); }else{ return true; } } public function tables(){ /*-------------------------------------*/ //------Creating Table List start------// /*-------------------------------------*/ $tb_name=mysql_query("SHOW TABLES"); $tables=array(); while ($tb=mysql_fetch_row($tb_name)) { $tables[]=$tb[0] ; } /*-------------------------------------*/ //-------Creating Table List end-------// /*-------------------------------------*/ return $tables; } public function view_fields($tablename){ $all_fields=array(); $fields = mysql_query("SHOW COLUMNS FROM ".$tablename); if (!$fields) { echo 'Could not run query: ' . mysql_error(); } if (mysql_num_rows($fields) > 0) { while ($field = mysql_fetch_assoc($fields)) { $all_fields[]="`".$field["Field"]."`"; } } return $all_fields; } public function view_data($tablename){ $all_data=array(); $table_data=mysql_query("SELECT*FROM ".$tablename); if(!$table_data){ echo 'Could not run query: '. mysql_error(); } if(mysql_num_rows($table_data)>0){ while ($t_data=mysql_fetch_row($table_data)) { $per_data=array(); foreach ($t_data as $key => $tb_data) { $per_data[]= "'".str_replace("'","\'",$tb_data)."'"; } $solid_data= "(".implode(", ",$per_data).")"; $all_data[]=$solid_data; } } return $all_data; } /*-------------------------------------*/ //---------Functions End here----------// /*-------------------------------------*/ //Export End here================================================================== //Import Start here================================================================== function db_import($file_path){ $tbl_query=null; foreach ($this->tables() as $key => $table) { $tbl_query=mysql_query("DROP TABLE IF EXISTS ".$table); } //--------------------------------------------------------------------------- //Forign code Start here //--------------------------------------------------------------------------- $templine = ''; // Read in entire file $lines = file($file_path); // Loop through each line foreach ($lines as $line) { // Skip it if it's a comment if (substr($line, 0, 2) == '--' || $line == '') continue; // Add this line to the current segment $templine .= $line; // If it has a semicolon at the end, it's the end of the query if (substr(trim($line), -1, 1) == ';') { // Perform the query mysql_query($templine) or print('Error performing query \'' . $templine . '\': ' . mysql_error() . '

'); // Reset temp variable to empty $templine = ''; } } //echo "Database imported successfully
"; return true; } }