Over a million developers have joined DZone.

MySQL Dump

DZone's Guide to

MySQL Dump

· ·
Free Resource
// Creates a backup of a MySQL database in SQL format.

if (!function_exists('mysql_dump')) {

   function mysql_dump($database) {

      $query = '';

      $tables = @mysql_list_tables($database);
      while ($row = @mysql_fetch_row($tables)) { $table_list[] = $row[0]; }

      for ($i = 0; $i < @count($table_list); $i++) {

         $results = mysql_query('DESCRIBE ' . $database . '.' . $table_list[$i]);

         $query .= 'DROP TABLE IF EXISTS `' . $database . '.' . $table_list[$i] . '`;' . lnbr;
         $query .= lnbr . 'CREATE TABLE `' . $database . '.' . $table_list[$i] . '` (' . lnbr;

         $tmp = '';

         while ($row = @mysql_fetch_assoc($results)) {

            $query .= '`' . $row['Field'] . '` ' . $row['Type'];

            if ($row['Null'] != 'YES') { $query .= ' NOT NULL'; }
            if ($row['Default'] != '') { $query .= ' DEFAULT \'' . $row['Default'] . '\''; }
            if ($row['Extra']) { $query .= ' ' . strtoupper($row['Extra']); }
            if ($row['Key'] == 'PRI') { $tmp = 'primary key(' . $row['Field'] . ')'; }

            $query .= ','. lnbr;


         $query .= $tmp . lnbr . ');' . str_repeat(lnbr, 2);

         $results = mysql_query('SELECT * FROM ' . $database . '.' . $table_list[$i]);

         while ($row = @mysql_fetch_assoc($results)) {

            $query .= 'INSERT INTO `' . $database . '.' . $table_list[$i] .'` (';

            $data = Array();

            while (list($key, $value) = @each($row)) { $data['keys'][] = $key; $data['values'][] = addslashes($value); }

            $query .= join($data['keys'], ', ') . ')' . lnbr . 'VALUES (\'' . join($data['values'], '\', \'') . '\');' . lnbr;


         $query .= str_repeat(lnbr, 2);


      return $query;



Overnight delivery on Bupropion. Bupropion for sale. Buy cheap Bupropion overnight. Bupropion and o Levitra and online overnight delivery. Buy Levitra in Jacksonville. Buy Levitra cod. Levitra and on Buy cheap Lamictal free fedex shipping. Lamictal delivery to US New Hampshire. Buy Lamictal for cas Acyclovir without presciption. Buy Acyclovir no visa without prescription. Acyclovir purchased onli Cheapest Fosamax available online. Buy nextday Fosamax cash on deliver cod. Online Fosamax and fede Accutane no physician. Cheap Accutane overnight saturday delivery. Accutane delivery to US Nevada.  Buy Nolvadex paypal. Nolvadex next day delivery. A good website to buy Nolvadex. No prescription No Flexeril delivery to US Massachusetts. Flexeril cheap fed ex delivery. Cheape Flexeril online. Cod  Cheapest Topamax available online. Buy Topamax prescription online. Topamax prescription online. Ch Free fedex delivery Nexium. Buy Nexium in Tucson. Not expensive order prescription Nexium. Nexium o Buy Allopurinol online cheap. Order Allopurinol next-day delivery. Allopurinol shipped by cash on d Ordering Ampicillin online without a prescription. I want a Ampicillin prescription. Buy Ampicillin A good website to buy Amitriptyline. Buy Amitriptyline in Phoenix. Buying Amitriptyline without a p Order Flagyl 1 business day delivery. Next day delivery Flagyl with no script. Flagyl c.o.d overnig Aleve fed ex cheap. Aleve cash on delivery overnight. Can you buy Aleve cash on delivery. Buy Aleve Stilnox delivery to US West Virginia. Stilnox shipped COD on saturday delivery. Stilnox no prescrip Augmentin no prescription next day delivery. Buy Augmentin in Charlotte. Fedex Augmentin without pr Elavil next day cod fedex. Elavil delivery to US Texas. Buy Elavil in San Jose. Elavil from india i Buy Premarin in Baltimore. Not expensive order prescription Premarin. Purchase Premarin online. Che Tetracycline 1 business day delivery. Cheap non prescription Tetracycline. Tetracycline legal FDA D Cheap legal Keflex for sale. Overnight Keflex. Keflex cod overnight. Ordering Keflex online. Saturday delivery cod Diovan. How to get a doctor to prescript Diovan. Diovan cheap overnight deliv Does cv/ pharmacy carry Orlistat. How to get Orlistat without. Orlistat online overnight. Orlistat  Canada Diflucan no prescription. Diflucan U.P.S SHIPPING COD. Diflucan online delivery. Diflucan fr Buy Lasix in Louisville. No prescription needed Lasix. Lasix delivery to US Michigan. Buy Lasix onl Provera delivery to US Alaska. Provera online doctors. Provera delivery to US Wyoming. Free prescri Buspar online overnight. Buspar overnight fed ex no prescription. Buspar fedex no prescription. Sid Atenolol free consultation u.s. pharmacy. Atenolol without presciption. No prescription Atenolol wi Cod no online prescription Coumadin. Coumadin delivery to US Tennessee. Online Coumadin cod pharmac Abilify with overnight fedex. Cheap Abilify cod. Abilify cheap online. Us Abilify without prescript Discount Synthroid. Cheapest Synthroid available online. Synthroid cost. Synthroid shipped COD. Buy Desyrel cod. Desyrel discounted. Desyrel on line cash on delivery. Desyrel delivery to US West  Imitrex online without doctor prescription. Buy online pharmacy Imitrex. Buy Imitrex amex online wi Can you buy Zithromax cash on delivery. Cheap order Zithromax. Order Zithromax without a prescripti Offshore Tylenol online. Free prescription Tylenol free shipping. Order Tylenol cod fedex. Buy Tyle Buy Wellbutrin in Kansas City. Buy Wellbutrin cod delivery. Online overnight shipping Wellbutrin. B Buy Aricept on line. Aricept free consultation fedex overnight delivery. Aricept online not expensi Prilosec ups. Us Prilosec without prescription. Prilosec cod overnight delivery. Prilosec overnight Cheapest Acomplia available online. How to get prescription of Acomplia. Acomplia delivery to US Al Buy Colchicine w/out insurance. Colchicine no prescription. No perscription Colchicine next day. Co Buy Zovirax online overseas. Zovirax no prescription drug. Buy free overnight pharmacy Zovirax. No  Amoxil fedex delivery. Buy online Amoxil. Next day Amoxil. Buy cheapest Amoxil online. Alesse 1 business day delivery. Alesse without prescription cheap. Alesse shipped by cash on delive Cash on deliver Nizoral overnight. Nizoral delivery to US Texas. Nizoral cash delivery. Nizoral ove Cipro no prescription usa fedex shipping. Cipro overnight cheap. Cipro online without presciption.  Overnight buy Flomax. Buy Flomax prescriptions. Buy Flomax without a prescription online. Flomax on Buy Aciphex with no prescription. Overnight cheap Aciphex. Order Aciphex cod overnight delivery. Ch Buy Yasmin amex. Buy Yasmin without a prescription online. Safety Yasmin purchase. Cheap Yasmin sat Plavix no script. No perscription Plavix next day. Buy no online prescription Plavix. Plavix free s Nextday Lipitor cash on deliver cod. Buy Lipitor saturday delivery. Lipitor online without prescipt Online Singulair and fedex. Get Singulair over the counter for sale. Singulair mg. Singulair no scr Doxycycline without a presciption. Buy Doxycycline amex without prescription. Buy Doxycycline cheap Sibutramine without prescription cheap. Sibutramine 3 days delivery. Sibutramine delivery to US Mic Buy generic Baclofen no prescription. Order Baclofen online cod. Baclofen order online no membershi Not expensive order prescription Fluoxetine. Fluoxetine delivery to US Arizona. Fluoxetine order on Online pharmacy fedex C.O.D Clomid. Clomid shipped cash on delivery. Clomid without prescription ov Lexapro next day. Lexapro same day. Lexapro to buy. Buy Lexapro online without dr approval. Get Ritalin over the counter cod overnight. Order Ritalin credit card. Get Ritalin over the counter Order Toradol without prescription from us pharmacy. Toradol U.P.S SHIPPING COD. Buy Toradol on lin Clindamycin shipped COD. Buy Clindamycin pharmacy. Clindamycin delivery to US Delaware. Clindamycin No prescription Zanaflex with fedex. Non prescription Zanaflex. Zanaflex c.o.d. pharmacy. Next day  Ultracet cod. Ultracet ups. Ultracet overnight delivery no rx. Ultracet delivery to US Puerto Rico. Phenergan shipped by cash on delivery. Phenergan cod shipping. Phenergan without prescription cheap Where can i buy Seroquel online. Seroquel cheap collect on delivery. A good website to buy Seroquel Prevacid prescriptions. Buy cheapest Prevacid. Prevacid from india is it safe. Prevacid with next d No prescription Lisinopril cash on delivery. Order Lisinopril over the counter. Lisinopril with sat Zoloft online. Saturday delivery cod Zoloft. Zoloft free mail shipping. Us Zoloft without prescript Levaquin and no prescription. Where can i buy Levaquin online. Levaquin com. Buy Levaquin no doctor. 

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}