Function returning text backup of MySQL database – PHP

Subject, does such a thing exist?

Answer 1, authority 100%

The omniscient Google immediately offers a lot of options 🙂 There are two main approaches (software):

  1. Backup each table individually by running a SELECT * ...query and saving the result to a file, use LOAD DATA INFILE ...
  2. to restore

  3. Call mysqldumpvia system()or shell_exec()

Both options are covered with code examples in this article.

Answer 2

This function does not exist, use various utilities, for example: mysqldump, phpmyadmin or any other utility.

Leave a reply

Please enter your comment!
Please enter your name here