php - get rid of string in mysql dump -
i created script dump database, script working there dont it.
the ( ' ), how dump tables without having remove in every column gets fetched?
this part of script looks like:
$query = $db->query("select * {$table}"); $numrows = mysqli_num_rows($query); if($numrows != 0) { $insert .= "insert {$table} ($fields) values \n"; while($row = $query->fetch_array()) { $insert .= "("; $comma = ''; foreach($field_list $field) { $row[$field] = preg_replace("#\'#", "", $row[$field]); $insert .= $comma."'".$db->real_escape_string($row[$field])."'"; $comma = ', '; } $insert .= "),\n"; } $insert = substr($insert, 0, -2); $insert .= ";\n";
i rid of string using code
$row[$field] = preg_replace("#\'#", "", $row[$field]);
and works, there way dump table without having remove , dump still able imported ?
thanks.
Comments
Post a Comment