php - Viewing escaped characters in database mysql? -
i using mysqli prepared statement insert values database. know extension handles characters escaping properly.
i have file path : images/serveover/bellini 83.png
, expecting see after insert file path escaped characters in database, images\/serveover\/bellini 83.png
see image path is.
how can make sure string has been escaped? view standard in phpmyadmin not show escaped characters or hiding them on view?
below insert prepared statement params values being filled :
$insertquery = $conn -> prepare("insert images (image_id, image_date_created, image_date_modified, image_title, image_src, category_id, image_status, image_external_file, another_id) values (null, now(), current_timestamp, ?, ?, ?,'a', ?, ?)"); if($insertquery ) { $insertquery -> bind_param("ssisi", $title, $image, $row["category_id"], $file, $row["id"]); $insertquery -> execute(); $insertquery -> close(); }
as long you're dealing strings, escaping process instructs mysql ignore special properties of character , treat normal character.
bob\'s special string
is entered database as
bob's special string
it's important note prepared statements don't use escaping @ all. prepared statements send query in 1 set , data in another, mysql doesn't need escape it, since knows that's actual value store.
you can read more process in mysql manual https://dev.mysql.com/doc/refman/5.0/en/string-literals.html
Comments
Post a Comment