MySQL Forums
Forum List  »  PHP

two datetime search
Posted by: senol sahin
Date: June 05, 2015 01:42AM

Hi, I
I can not make calls between two Date Time

Table

Datetime_

colums

id > int
StartDatetime > datetime
EndDatetime > datetime

tablo data

id > 1 StartDatetime > 2015-06-01 00:00:00 EndDatetime > 2015-06-30 00:00:00
id > 2 StartDatetime > 2015-07-01 00:00:00 EndDatetime > 2015-07-31 00:00:00
id > 3 StartDatetime > 2015-08-01 00:00:00 EndDatetime > 2015-08-31 00:00:00


sql select * from Datetime_ where `StartDatetime `<='2015-07-08 18:20:58' and `EndDatetime `>='2015-07-08 18:20:58'

result 0

php

require_once ('MysqliDb.php');

$users = $db->rawQuery("sql select * from Datetime_ where `StartDatetime `<='2015-07-08 18:20:58' and `EndDatetime `>='2015-07-08 18:20:58'", Array ());


foreach ($users as $user) {
print_r ($user);
}

result 0

help
guy

Options: ReplyQuote


Subject
Written By
Posted
two datetime search
June 05, 2015 01:42AM
June 05, 2015 12:44PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.