I was wondering if I should be using prepared statements for simple select queries?
Such as:
`SELECT * FROM `table_name`
With this, wouldn’t it be better to just do:
$db->query('SELECT * FROM `table_name`');
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the query is only run once (per script) and there are indeed no variables in it, it indeed doesn’t make much of a difference whether you use prepared statements or a one-off query.