Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Forum: Plugins
    In reply to: Building log hour counter..
    Thread Starter rustersen

    (@rustersen)

    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..
    Thread Starter rustersen

    (@rustersen)

    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..
    Thread Starter rustersen

    (@rustersen)

    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..
    Thread Starter rustersen

    (@rustersen)

    Ok, I will set aside a weekend for it! 🙂
    Thank you for your replies…

    Steffen.

    Forum: Plugins
    In reply to: Building log hour counter..
    Thread Starter rustersen

    (@rustersen)

    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
    In reply to: Building log hour counter..
    Thread Starter rustersen

    (@rustersen)

    Hmm, sorry I dont have much coding experience, how can these fields help me?

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