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 8925411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:41:22+00:00 2026-06-15T07:41:22+00:00

This is a bit from the query, a roster type database is looked at

  • 0

This is a bit from the query, a roster type database is looked at comparing current user and obtains data from the database. It always starts with today’s date and ends 12 days later using unix time.

<?php
$INQID = $member->userID();
$loc = $member->UserLocation();
$range_start = time();
$range_end = $range_start + 1036800;
$username = "******";
$password = "******";
$hostname = "******";
$dbhandle = mysql_connect($hostname, $username, $password)
             or die("Unable to connect to MySQL");
$selected = mysql_select_db("DATABASE",$dbhandle)
             or die("Could not select DATABASE");
$result = mysql_query("SELECT username, date, state FROM ".$loc."  WHERE username
=$INQID  and date > $range_start and date < $range_end");
$result_array = array();

My question is how can I add a button to move the start date forward or back by 10368000 (twelve days unix time) which in turn will move the end date, showing the user the next 12 days. while preserving the start date when the user logs in? I would like to stick with unix time as the shifts cover 24 hours so it is easier for me to use.

  <div id="Rbutt">
<a href="#" class="Rbuttons">Next</a>
</div>
<div id="Lbutt">
<a href="#" class="Rbuttons">Back</a>
</div>

I have two buttons left(-) and right(+) I would like to use however changing these is not a issue.

  • 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-06-15T07:41:23+00:00Added an answer on June 15, 2026 at 7:41 am

    Try something like the following:

    <?php
    
    $INQID = $member->userID();
    $loc = $member->UserLocation();
    $range_start = time();
    if(isset($_POST['timeRange'])) {
        $range_end = $range_start + $_POST['timeRange'];
    }
    else {
        $range_end = $range_start + 1036800;
    }
    $username = "******";
    $password = "******";
    $hostname = "******";
    $dbhandle = mysql_connect($hostname, $username, $password)
                 or die("Unable to connect to MySQL");
    $selected = mysql_select_db("DATABASE",$dbhandle)
                 or die("Could not select DATABASE");
    $result = mysql_query("SELECT username, date, state FROM ".$loc."  WHERE username
    =$INQID  and date > $range_start and date < $range_end");
    $result_array = array();
    

    With the following HTML code:

    <form action="filename.php" method="post">
        <input name="timeRange" type="hidden" value="1036800" />
        <input type="button" class="Rbuttons" value="next" />
    </form>
    
    <form action="filename.php" method="post">
        <input name="timeRange" type="hidden" value="-1036800" />
        <input type="button" class="Rbuttons" value="back" />
    </form>
    

    Unfortunately I haven’t tested the above code (so I hope it’s right and actually works!) regardless, I think this should help point you in the right direction.

    Obviously the input should be sanitized, but I’ll leave that to you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query that looks a bit like this: SELECT weekEnd, MAX(timeMonday) FROM
I use this bit of code to feed some data i have parsed from
What does the PCGPRLEN-1..28 means here?? Where does this 4 bit comes from? alt
This is an example from: dofactory I reformatted it a bit for better fit
This is an example from a book, a bit modified. It seems like sessions
This may be a bit of daft question, but I don't come from an
Although this code is from an algorithm text, I have a bit of a
Quote from Wikipedia : A public key token. This is a 64-bit hash of
I have a query that looks a bit like this (note: the actual query
I need help converting this bit of T-SQL into an ActiveRecord Query select entry

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.