Jump to content

blitz

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by blitz

  1. It was originally TIME, it got me in a lot of trouble so i changed it to VARCHAR. And it brought me a lot lot more trouble hahaha. Anyway I kinda got the work around already. I insert all record returns to an array and then using array_sum divide it by count of the array. and some more modifications based on my spagehetti code hehehe Thanks everyone!
  2. Hmm. Thanks, it seemed to work on numbers. But it returns 0 when adding time. Basically i would like to get the sum of all records in post_time_dif and get the average.
  3. Hello phpfreaks!, I know the title is really confusing. But let me explain. I need a little help here. $queryreport = mysql_query("SELECT post_time_dif FROM response WHERE profile_id = '$id'"); while($row = mysql_fetch_array($queryreport)){ $post_time_dif = $row['post_time_dif']; $post_time_dif_tot += $post_time_dif; } Basically what I want to do is add all values from post_time_dif and put the total in $post_time_dif_tot variable Running the above code gives me an error Im relatively new @php so any help or idea would really be appreciated. Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.