MySQL Query : Advise Needed.
Posted
by Rachel
on Stack Overflow
See other posts from Stack Overflow
or by Rachel
Published on 2010-03-19T15:47:41Z
Indexed on
2010/03/19
15:51 UTC
Read the original article
Hit count: 143
mysql
"SELECT id as Id from dbTable WHERE code = ? AND CURDATE() BETWEEN
start_date AND end_date AND offerId IN ('12321', '12124')";
//Passing arguments for the query
$args = array_merge(array(51342),$offerid);
//Execute the prepared query
$statement->execute($args);
Now array(51342) represents combination of code+value, aside my database has value, code columns
and so I want a query which would look logically like
"SELECT id as Id from dbTable WHERE code and value
(Note here I do not know the syntax, what am looking at is (code+value = ?), please advise on query) = ?
AND CURDATE() BETWEEN start_date AND end_date AND offerId IN ('12321', '12124')";
© Stack Overflow or respective owner