Greetings I tried to export a table from a database from PHP but I think I'm not using the correct extension. Please explain and thank you in advance.
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 / tu_table.sql' (you must specify the path where the file with the .sql extension will be saved)