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

  • Home
  • SEARCH
  • 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 6664899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:39:54+00:00 2026-05-26T02:39:54+00:00

$result= db_query(SELECT dayoff FROM specificdayoff); $node->frmdate = mktime(0,0,0, $node->frmdate[‘month’], $node->frmdate[‘day’],$node->frmdate[‘year’]); $node->todate = mktime(0,0,0, $node->todate[‘month’],

  • 0
$result= db_query("SELECT dayoff FROM specificdayoff");
$node->frmdate = mktime(0,0,0, $node->frmdate['month'], $node->frmdate['day'],$node->frmdate['year']);
$node->todate = mktime(0,0,0, $node->todate['month'], $node->todate['day'],$node->todate['year']);
$node->dayoff = mktime(0,0,0, $node->dayoff['month'], $node->dayoff['day'],$node->dayoff['year']);
$data = $node->dayoff;
$frmdate = $node->frmdate;
$todate = $node->todate;    

$iii=0;
while($frmdate!=$todate)
{
    while($data= db_fetch_object($result))
    {
        if($frmdate==$data)
        {
            $iii++;
           //debug
        }

    }
    $frmdate=mktime(0, 0, 0, date("m", $frmdate), date("d", $frmdate)+1, date("Y", $frmdate));
    //debug2     
   }
$diff=$iii

I need every element of $frmdate to be compared with all element of $data. but when I run this code, $diff keep returning 0. meaning to say, there’s something wrong with my if statement, but I can’t seem to figure out what is wrong with it.

when I debug this block of code, both while loop did not run as i want it. the 2nd while loop only run once. I need the 2nd while loop to be run every time 1st while loop is running. any help?

the debug run like this:
debug
debug
debug
debug2
debug2
debug2

i need it to run like this:
debug
debug
debug
debug2
debug
debug
debug
debug2
debug
debug
debug
debug2

  • 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-26T02:39:54+00:00Added an answer on May 26, 2026 at 2:39 am

    I get the feeling you have a timestamp in your specificdayoff table. If this is the case, then your db_fetch_object method will retrieve an object that has dayoff property.

    To access this you would use $data->dayoff. So you need to change the condition of the if($frmdate==$data) to if($frmdata == $data->dayoff)

    This is all a guess without knowing exactly what your db_fetch_object will return. That said, I still don’t follow exactly what is supposed to be happening here, and this may just be one of a few problems you have.

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

Sidebar

Related Questions

In Drupal, I can execute a SQL as follows: $query_object = db_query(SELECT * FROM
The code: $msr = db_query(SELECT * FROM users WHERE username='$username'); if (db_num_rows($msr) == 0)
function displayList() { $str = ''; $query = $this->db->query(SELECT * FROM data); foreach ($query->result()
PHP: Code: $category_searchresult = $db->db_query(SELECT category_code, category_name, category_comment FROM qa_categories WHERE .$search_by. LIKE '%.$search_string.%');
import _mysql as mysql db=mysql.connect('localhost','username','password','database') db.query(select * from news) result = db.store_result() print result.num_rows()#two
I have a very simple query $this->db->select('id, title'); $this->db->order_by('id', 'DESC'); $query = $this->db->get('journal'); foreach($query->result()
var result = db.PhotoAlbums.Select(albums => new PhotoAlbumDisplay { AlbumID = albums.AlbumID, Title = albums.Title,
Code: var result = db.rows.Take(30).ToList().Select(a => AMethod(a)); db.rows.Take(30) is Linq-To-SQL I am using ToList()
var result = from lr in _db.LeaveRequest join th in _db.TotalHourslu on lr.TotalHoursEffect equals
var result = from lr in _db.LeaveRequest join th in _db.TotalHourslu on lr.TotalHoursEffect equals

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.