It depends on which SQL library you use within PHP.
If you use the PDO
library you can use named parameters, which comes to the same thing as using numbers. http://php.net/manual/en/pdostatement.bindparam.php gives an example of this:
$calories = 150;
$colour = 'red';
$sth = $dbh->prepare('SELECT name, colour, calories
FROM fruit
WHERE calories < :calories AND colour = :colour');
$sth->bindParam(':calories', $calories, PDO::PARAM_INT);
$sth->bindParam(':colour', $colour, PDO::PARAM_STR, 12);
$sth->execute();
In the above, since the parameters are named, it would not matter in which order you supply the "calories" and "colour" variables, or where they occur in the statement.
However mysqli
does not support this, and instead you have to use simple ?
placeholders, and then supply the parameters in the exact order they are to be used - see http://php.net/manual/en/mysqli-stmt.bind-param.php.