Answer the question
In order to leave comments, you need to log in
PDO php questions?
Small code, search by TIMESTAMP type field:
$a = '2007-08-09 01:00:00';
$b = '2007-08-09 08:00:00';
$st = $pdo->prepare('set profiling=1');
$st->execute();
$st = $pdo->prepare('SELECT `mytime` FROM `date` WHERE `mytime` BETWEEN a=:a AND b=:b ');
$st->bindParam(':a', $a, PDO::PARAM_STR);
$st->bindParam(':b', $b, PDO::PARAM_STR);
$st->execute();
$RES = $st->fetchAll();
SELECT `mytime` FROM `date` WHERE `mytime` BETWEEN '2007-08-09 01:00:00' AND '2007-08-09 08:00:00'
Answer the question
In order to leave comments, you need to log in
1) dev.mysql.com/doc/refman/5.7/en/show-profile.html
2) between is written like this: dev.mysql.com/doc/refman/5.7/en/comparison-operato...
Compare with yours .
3) php.net/manual/en/pdostatement.bindparam.php , $data_type = PDO::PARAM_STR. Is there anything else that needs to be explained?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question