i have read countless articles but was wondering if someone could explain the difference to me in laymans terms? i know they both protect against sql injection and are for security. but if im using mysqli to run a query , or the old fashioned way of my_sql_query, does it really matter which one i use? are not they both wrappers anyway for the sql function?
why does the below code not work?
$test="hello, 'there";
$db->real_escape_string($test);
$db->query("INSERT INTO users (first_name) VALUES ('$test')");