Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6342599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:16:16+00:00 2026-05-24T20:16:16+00:00

So I am working on a way of transforming a timer which appears like

  • 0

So I am working on a way of transforming a timer which appears like this in HTML:

00:00:00

in hh/mm/ss – and I want to input it into my database but with it just as an integer value depicting the total seconds driven.

This is the method I have used to do this, where ‘timedrive’ is the form holding the time value, eg: “02:21:51”.

$length = mysql_escape_string($_REQUEST['timeDrive']);

        $parts = explode(":", $length);

        $totalSeconds = parts[0] * 3600 + parts[1] * 60 + parts[2];

Nevertheless it is not working for what ever reason, I get this error:

Parse error: syntax error, unexpected '[' in /home/benjamin/public_html/elog/iframe/addtodatabase.php on line 17

this is line 17:

$totalSeconds = parts[0] * 3600 + parts[1] * 60 + parts[2];

Thanks heaps for the help with this one!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:16:18+00:00Added an answer on May 24, 2026 at 8:16 pm

    You need a $ before your variable references:

    $totalSeconds = $parts[0] * 3600 + $parts[1] * 60 + $parts[2];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working my way around the SOS commands and their output, but I noticed
I'm working my way through Agile Web Development with Rails and am running into
I've been working my way through Tim Heuer's Silverlight tuturial , in which you
Does anyone have a confirmed/tested working way of setting up a rich WYSIWYG (like
Working my way through Learn Python the Hard Way ex.25, and I just can't
This may be a basic problem in the database world but I don't speak
I'm working on a very basic scheduled FTP program, but I don't want to
I searched a lot over the web but I didn't fine a working way
I'm working on a small hobby project for personal use, which requires a way
I can't find i smooth 100% working way to keep my app in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.