one tiny little problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kiqyou_vf

    one tiny little problem

    this doesnt work: i believe it is $row_QCBD_GHOUR S["$day2"] that is the
    problem.

    // assign $day var
    $day1= date('D')."1";
    $day2= date('D')."2";
    $open= $row_QCBD_GHOUR S["$day1"];
    $close= $row_QCBD_GHOUR S["$day2"];
    $hour= date('h') + 2;
    $minute= date(i);
    $time= $hour . ".$minute";

    //ghours
    if (($time > $row_QCBD_GHOUR S["$day1"]) && ($time <
    $row_QCBD_GHOUR S["$day2"])){
    $openclose= '<font color=green>Ope n</font>';
    }else{ $openclose= '<font color=red>Close d</font>';
    }

    when i change $row_QCBD_GHOUR S["$day2"] to a number it works like its
    supposed to, so for some reason $row_QCBD_GHOUR S["$day2"] in that
    location is not working. i can print out $row_QCBD_GHOUR S["$day2"] in
    other places and it works, just not in that location. so i dont know, i
    have no idea. if anyone can help me thatd be great. thanks a lot.

  • Ken Robinson

    #2
    Re: one tiny little problem


    kiqyou_vf wrote:[color=blue]
    > this doesnt work: i believe it is $row_QCBD_GHOUR S["$day2"] that is the
    > problem.
    >
    > // assign $day var
    > $day1= date('D')."1";
    > $day2= date('D')."2";
    > $open= $row_QCBD_GHOUR S["$day1"];
    > $close= $row_QCBD_GHOUR S["$day2"];
    >[/color]

    Remove the quotes from around $day1 and $day2. You want the value of
    the variables to be your index, not the strings.

    Ken

    Comment

    • kiqyou_vf

      #3
      Re: one tiny little problem

      It still doesn't work. I continue to have problems with
      $row_QCBD_GHOUR S[$day2] with or without double quotes, when I replace
      it with the number that it should be returning everything works as it
      should. I can print out $row_QCBD_GHOUR S[$day2] (with or without double
      quotes) but I can't print out $close. SOoooooo confused.

      Comment

      • kiqyou_vf

        #4
        Re: one tiny little problem

        i dont know, for some reason it just started working. thanks for your
        help.

        Comment

        Working...