If you just want to dump the values, you can use something like
PHP Code:
require_once( '/path/to/your/mysqlconnection.ini.php') ;
# the above connects to the DB and sets $link as the connection handle
$export_sql = "INSERT INTO `five` (`id`, `word`) VALUES " ;
$sql = "SELECT id, word FROM five " ;
$result = mysqli_query( $link , $sql ) ;
if(! $result ){
# OR HOWEVER YOU WANT TO HAND DB ERROR HERE
echo "Query problem: " . mysqli_error($link);
mysqli_close( $link );
die();
}
$first = true ;
while( $record = mysqli_fetch_row( $result )){
if( ! $first ){ $export_sql .= ", " ; }
$first = false;
# id is a number, no quotes while word is text and requires quotes
$export_sql .= "($record[0], '$record[1]')" ;
}
mysqli_close( $link );
echo $export_sql ;
This of course assumes you know the structure of the table you are going to dump.
If you want a more general method that will examine the table info and adjust itself to different number of columns and column names, that can be done.