Title: rustersen's Replies | WordPress.org

---

# rustersen

  [  ](https://wordpress.org/support/users/rustersen/)

 *   [Profile](https://wordpress.org/support/users/rustersen/)
 *   [Topics Started](https://wordpress.org/support/users/rustersen/topics/)
 *   [Replies Created](https://wordpress.org/support/users/rustersen/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/rustersen/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/rustersen/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/rustersen/engagements/)
 *   [Favorites](https://wordpress.org/support/users/rustersen/favorites/)

 Search replies:

## Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Building log hour counter..](https://wordpress.org/support/topic/building-log-hour-counter/)
 *  Thread Starter [rustersen](https://wordpress.org/support/users/rustersen/)
 * (@rustersen)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/building-log-hour-counter/#post-888649)
 * 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](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Building log hour counter..](https://wordpress.org/support/topic/building-log-hour-counter/)
 *  Thread Starter [rustersen](https://wordpress.org/support/users/rustersen/)
 * (@rustersen)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/building-log-hour-counter/#post-888643)
 * 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](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Building log hour counter..](https://wordpress.org/support/topic/building-log-hour-counter/)
 *  Thread Starter [rustersen](https://wordpress.org/support/users/rustersen/)
 * (@rustersen)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/building-log-hour-counter/#post-888639)
 * 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](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Building log hour counter..](https://wordpress.org/support/topic/building-log-hour-counter/)
 *  Thread Starter [rustersen](https://wordpress.org/support/users/rustersen/)
 * (@rustersen)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/building-log-hour-counter/#post-888591)
 * Ok, I will set aside a weekend for it! 🙂
    Thank you for your replies…
 * Steffen.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Building log hour counter..](https://wordpress.org/support/topic/building-log-hour-counter/)
 *  Thread Starter [rustersen](https://wordpress.org/support/users/rustersen/)
 * (@rustersen)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/building-log-hour-counter/#post-888553)
 * 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,
    Steffen
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Building log hour counter..](https://wordpress.org/support/topic/building-log-hour-counter/)
 *  Thread Starter [rustersen](https://wordpress.org/support/users/rustersen/)
 * (@rustersen)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/building-log-hour-counter/#post-888499)
 * Hmm, sorry I dont have much coding experience, how can these fields help me?

Viewing 6 replies - 1 through 6 (of 6 total)