Sql queries binding variables vs specifying them
问题 I am creating a simple query in mySql to insert some values from a form into my db. My question is simple, but in reference to the difference between binding variables vs specifying them into the sql statement. Binding: $query = "INSERT INTO test (name, lastName, price) VALUES (:name, :lastName, :price)"; $apply = $con -> prepare($query); $apply -> execute (array(':name'=>$name,':lastName'=>$lastName,':price=>$price')); Typical: $query = "INSERT INTO test (name, lastName, price) VALUES ($name