How can I avoid the quote when getting a record from the database?
I am adding records to my database with the $wpdb
following:
$title = 'test url';
$content = '<a href="#">test</a>'
$wpdb->insert($db_name, array(
"title" => $title,
"content" => $content
), '%s');
when i check the database i can see that the content is accepting a backslash with quotes like this: <a href=\"#\">test</a>
I tried to get the record from the database using stripcslashes()
, but dosnt work.
Is there a way to do this for security reasons too?
+3
source to share