Reputation: 2385
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.
Upvotes: 1
Views: 520
Reputation: 34632
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.
Upvotes: 2
Reputation: 79185
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.
Upvotes: 0
Reputation: 395
http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_between
Upvotes: 1