How bout using an insert & select to do this?
mysql_db_query($db,"INSERT INTO backup (col1, col2, col3) SELECT col1, col2, col3 FROM back_me_up");
The problem with doing everything in PHP is that it takes a while to move the data into PHP then back to the database but more importantly bin data needs to be at least quoted.
try this:
$query_get_data = mysql_db_query("db","SELECT * FROM $table_from");
while($query_get_data_row = mysql_fetch_array($query_get_data))
{
$bin_data = $query_get_data_row["bin_data"];
mysql_db_query("db","INSERT INTO $table_to SET bin_data='$bin_data'");
}
I use something similiar with images and it works great, but using the "INSERT INTO values SELECT data" is your best bet.
If it still fails post the code you're using to move the data.