This topic is locked

Problem On Setting The Monthly Instead Daily

1/8/2013 2:57:44 AM
PHPRunner General questions
L
lkh11lkh author

hi everyone

global $dal;

$message="<b>Search by Users</b>
";

//users

$dal_table=$dal->Table("data");

$str = "select count(Users) as numbers, Users from ".$dal_table->TableName()." group by Users";

$rs = CustomQuery($str);

while ($data = db_fetch_array($rs))

{

$users = str_replace(" ","+",$data["Users"]);

$message.="<a href=\"data_list.php?ctlSearchFor=".$users."&srchOptShowStatus=0&ctrlTypeComboStatus=0&srchWinShowStatus=0&a=integrated&id=1&criteria=and&value11=".$users."&field1=Users&option1=Contains\">".$data["Users"]." (".$data["numbers"].")</a>
";
//year month

(Posted)) AS yearname FROM ".$dal_table->TableName()." GROUP BY date_format(Posted,'%X-%m'), Month(Posted), concat(Year(Posted),\" \",Month(Posted)) ORDER BY Month(Posted) DESC, concat(Year(Posted),\" \",Month(Posted))";

$str2 = "select count(Users) as numbers2, Posted from ".$dal_table->TableName()." where Users='".$data["Users"]."' group by Posted";
$rs2 = CustomQuery($str2);

while($data2=db_fetch_array($rs2))

{

$YearName2 . "&srchOptShowStatus=0&ctrlTypeComboStatus=0&srchWinShowStatus=0&a=integrated&id=1&criteria=and&value11=" . $YearName2 . "&field1=yearname&option1=Contains>";
$posted = str_replace(" ","+",$data2["Posted"]);

$message.="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"data_list.php?ctlSearchFor=".$posted."&srchOptShowStatus=0&ctrlTypeComboStatus=0&srchWinShowStatus=0&a=integrated&id=1&criteria=and&value11=".$posted."&field1=Posted&option1=Contains\">".$data2["Posted"]." (".$data2["numbers2"].")</a>
";
}
}
$xt->assign("ListOnLoad",$message);



//output



Search by Users
1 (7)

2012-12-20 (1)

2012-12-26 (1)

2013-01-08 (5)
2 (2)

2012-12-26 (1)

2012-12-27 (1)
3 (2)

2012-12-26 (2)
//i hope to be like that

Search by Users
1 (7)

2012-12 (2)

2013-01 (5)
2 (2)

2012-12 (2)
3 (2)

2012-12 (2)
please advise with thanks. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=20501&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />

C
cgphp 1/8/2013

What is the question?

L
lkh11lkh author 1/8/2013



What is the question?


sorry.
my question is how do i achieve the output of year-month (total number per month) instead of year-month-day (total number per day)
please advise with thanks