I've written a custom plugin to send data via a form to a personal database, different from the WP one. Everything is working fine except the fact that when you write a name, for example "D'ALESSANDRO", it's saved as "D\'ALESSANDRO".
This is how I'm sending data to database:
$custom_field = sanitize_text_field($_POST[custom_field])
if ( count($reg_errors->get_error_messages()) < 1) {
$userdata = array(
........
'id_locality' => $custom_field
........
);
$where_data = array(
.......wherefield...........
);
$pldb = new wpdb('user', 'pwd', 'db', 'localhost');
$update_table = $pldb->update('table',$userdata,$where_data);
I need to save data into the database without the "\", I can't sort this when printing it.
How can I do this?
Aucun commentaire:
Enregistrer un commentaire