I read countless articles, but wondered if anyone could explain to me the difference in lay terms. I know that both of them protect against SQL injection and for security. but if im use mysqli to run the query or the old-fashioned method my_sql_query, does it really matter which one I use? aren't they both wrappers for the sql function anyway?
why is the code below not working?
$test="hello, 'there";
$db->real_escape_string($test);
$db->query("INSERT INTO users (first_name) VALUES ('$test')");
source
share