rustersen
Forum Replies Created
-
Forum: Plugins
In reply to: Building log hour counter..Ok, just got the code I was looking for from another forum:
// Make a mysql Connection
$query = mysql_query(“SELECT sum(meta_value) AS ‘meta_sum’ FROM wp_postmeta WHERE meta_key=’Hours'”) OR DIE(mysql_error());while($row = mysql_fetch_assoc($query))
{
echo $row[‘meta_sum’];
}Forum: Plugins
In reply to: Building log hour counter..Exactly! ..and I’m having trouble with that, so I was hoping for help through this forum.
The phphMyAdmin can show the querie in php-code, but that doesn’t help me much eather:
$sql = ‘select SUM(meta_value) from wp_postmeta WHERE meta_key=\’Hours\”
Forum: Plugins
In reply to: Building log hour counter..Ok, I have added a custom field to my post, called it ‘Hours’
When I do this lookup in phpmyadmin it displays the total hours:
select SUM(meta_value) from wp_postmeta WHERE meta_key=’Hours’
But what is the code to add this to my website sidebar?
Forum: Plugins
In reply to: Building log hour counter..Ok, I will set aside a weekend for it! 🙂
Thank you for your replies…Steffen.
Forum: Plugins
In reply to: Building log hour counter..Hi macsoft,
Thanks you for trying to help, but maybe I expressed my needs badly. I am not trying to calculate how much time I spend on writing the blog, but how much time I spend on building the plane I write about on my blog. If you look at my blog, you can see that I add the spent hours at the end of each post title.
My thoughts were, if I could write these numbers in a post field somehow, a script could calculate the total hours spent and display it on my website menu.best regards,
SteffenForum: Plugins
In reply to: Building log hour counter..Hmm, sorry I dont have much coding experience, how can these fields help me?