Prepared statements - fetch number of rows then return info

Can you use a placeholder to build part of your query, given what @Dormilich said above?

makes no sense, did you mean

$name = "jo";
$b = "AND a.age IN(?,?,?)";

and

WHERE n.name = ? $b AND etc...

Use variables for parts of the SQL to be substituted and placeholders for data. Do not use variables for data or try to use placeholders for parts of the SQL.

The placeholders keep the data separate from the SQL.

Hi felgall,

yes thank you, you are right. Looks like I’m getting somewhere with this. Thanks for everyone’s help.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.