SELECT COUNT(*) AS test FROM %s WHERE id = %d AND tmp_mail <> ''
What are %s
and %d
for?
SELECT COUNT(*) AS test FROM %s WHERE id = %d AND tmp_mail <> ''
What are %s
and %d
for?
Those are format symbols used e.g. by sprintf()
. Example:
<?php
$sql_template = "SELECT COUNT(*) AS test FROM %s WHERE id = %d AND tmp_mail <> ''";
$sql_real = sprintf($sql_template, 'sometable', 12345);
echo $sql_real;
?>
Output:
SELECT COUNT(*) AS test FROM sometable WHERE id = 12345 AND tmp_mail <> ''