Henriquez10 Asked: 2020-03-03 22:47:50 +0800 CST 2020-03-03 22:47:50 +0800 CST 2020-03-03 22:47:50 +0800 CST Export database table from PHP with SQL format 772 Hello, I have tried to export a table from a database from PHP but I think I am not using the correct extension. Please explain and thank you in advance. php 1 Answers Voted Best Answer mibot 2020-03-10T00:36:16+08:002020-03-10T00:36:16+08:00 Try the following: <?php $bd_host = "localhost"; $bd_user = "xxx"; $bd_pass = "xxx"; $bd_nombre = "xxx"; $con = new mysqli($bd_host, $bd_user, $bd_pass, $bd_nombre); if($con->connect_errno > 0) { die('Conexion fallida [' . $db->connect_error . ']'); } $tbl_nombre = 'tu_tabla'; $respaldoSQL = 'respaldo/tu_tabla.sql'; $query = "select * into outfile '$respaldoSQL' FROM $tbl_nombre"; $result = mysqli_query($con,$query); ?> In 'backup/your_table.sql' (you must specify the path where the file with extension .sql will be saved)
Try the following:
In 'backup/your_table.sql' (you must specify the path where the file with extension .sql will be saved)