note 21219 rejected from function.substr-count by sander
| From: | sander@php.net | Date: | Fri, 03 May 2002 17:40:48 +0000 |
| Subject: | note 21219 rejected from function.substr-count by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-30131@lists.php.net to get a copy of this message | ||
how do i get back a total count from a specific field?
meaning i want to get back total posts,posts perday,& users percent of total posts posted on my
forum
something like this right?
$countposts = mysql_query("SELECT posts, count(*) AS count from {$db_prefix}members group by
posts");
$posts = mysql_fetch_array($countposts);
$totalposts = $posts;
$percentoftotalposts = (round(($memsettings[6] / $totalposts[count]) * 100,2));
$postsperday = "$memsettings[6]";
$postsperday = sprintf("%.2f",($memsettings[6]) / ($memsettings[14]));
memsettings[6] is predefined and works the only one im trying to retrieve is totalposts how do i do
this?
also how would i retrieve this from a function using these variables?