This topic is locked

how to create dynamic tab from today value

12/21/2017 2:39:13 AM
PHPRunner General questions
M
mersintarim author

hi,

I have date field name is tarih,
$sql = "select * from mytable";

$rs = CustomQuery($sql);

while ($data = db_fetch_array($rs)) {
$pageObject->addTab("tarih='".$data["tarih"]."'",

date('d.m.Y',$data["tarih"]), $data["tarih"]);

}

but not working
how to create dynamic tab from today value?
thnx.

Sergey Kornilov admin 12/21/2017

See this for inspiration:

https://xlinesoft.com/blog/2017/07/11/creating-grid-tabs-dynamically/
It will work if you implement it properly. I think the problem is your date() function call. This function expects second parameter to be a timestamp while you are supplying $data["tarih"] which is a formatted date.
As a first step try to implement it without using date() function but rather using raw data from that table.