Pergunta

Can anyone guide me to or provide how the dual question marks work in a BETWEEN comparison.. I can't get it to work and I can't locate or search these data on the MySQL site and Google - bunches of random results.

Foi útil?

Solução

Guessing here.

You probably encountered a query like

SELECT `foo` FROM `bar` WHERE `datetime` BETWEEN ? AND ?

The question marks are placeholders for the actual values to be queried. Usually, the values are properly escaped prior to being "inserted" in the query in order to prevent SQL injection.

Outras dicas

Your question is not clear for me, but it seems what you want is know what the interrogation marks are for.

It seems that the interrogation marks are placeholders. They are replaced by constants (be it integers or sql-escaped strings) when querying, with a vector of values.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top