Xtremer360 Posted August 23, 2011 Share Posted August 23, 2011 What I'm wanting to do is instead of March-July have it always display the last 5 months and for the Visits th have it display the number of hits to my main page for each month and display the number of logins for each month to my CMS script. Can someone point me in the right direction? <?php function get_visit_data_table() { echo "<table class=\"visualize_dashboard\">"; echo "<caption>Dashboard Chart Example</caption>"; echo "<thead>"; echo "<tr>"; echo "<td></td>"; echo "<th scope=\"col\">March</th>"; echo "<th scope=\"col\">April</th>"; echo "<th scope=\"col\">May</th>"; echo "<th scope=\"col\">June</th>"; echo "<th scope=\"col\">July</th>"; echo "</tr>"; echo "</thead>"; echo "<tbody>"; echo "<tr>"; echo "<th scope=\"row\">Visits</th>"; echo "<td>175</td>"; echo "<td>145</td>"; echo "<td>212</td>"; echo "<td>175</td>"; echo "<td>182</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\">Logins</th>"; echo "<td>94</td>"; echo "<td>53</td>"; echo "<td>124</td>"; echo "<td>92</td>"; echo "<td>105</td>"; echo "</tr>"; echo "</tbody>"; echo "</table>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/245529-table-of-data/ Share on other sites More sharing options...
WebStyles Posted August 24, 2011 Share Posted August 24, 2011 current month: $currentMonth = date("F"); current -1 month: $lastMonth = date("F",strtotime("- 1 month")); current -2 month: $monthBeforeLast = date("F",strtotime("- 2 months")); current -3 month $aLongTimeAgo = date("F",strtotime("- 3 months")); etc... Quote Link to comment https://forums.phpfreaks.com/topic/245529-table-of-data/#findComment-1261252 Share on other sites More sharing options...
erdem Posted August 24, 2011 Share Posted August 24, 2011 why don't you use time() function and insert into your database? $ROW['LastAction'] = date( 'H:i:s', $ROW['LastAction'] ); Quote Link to comment https://forums.phpfreaks.com/topic/245529-table-of-data/#findComment-1261271 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.