Jump to content

puntapuisomos

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Posts posted by puntapuisomos

  1. I get three values after a distinct-query.

    <?

    $querydd = "Select distinct(smth) From offer WHERE whatever='2' Order By smth";

    $resultdd = mysql_query($querydd);

    while($smth = mysql_fetch_row($resultdd)) {

    echo ("$smth[0]<br>");

    }

    ?>

    Let's say the echo gives this1, this2 and this3. Now I want to start another query in which "this1" must be put in a where-clause. How van I turn the this1, this2 and this3 into a $this1 $this2 and $this3?

    Thanks!

  2. I have made a system with which teachers can book class rooms. In the database the following data are stored: date, time & period, classroom, teacher code.

    When asked for a survey appears that lists the bookings as follows (with more data, but this is the basis):

    2008-03-05: Room G15, period 1: 08.30, (MNA) Mike Nameful

    2008-03-05: Room G15, period 3: 10.10, (KKN) Karl Knowbody

    I would, however, like the list also to include the periods that do not have any bookings: so actually my list would like this:

    2008-03-05: Room G15, period 1: 08.30, (MNA) Mike Nameful

    2008-03-05: Room G15, period 2: 09.20, <empty>

    2008-03-05: Room G15, period 3: 10.10, (KKN) Karl Knowbody

    I have the following script (sorry for the Dutch words but I am sure you will get around with it...):

    <?

    $query1="select lokaal, week, datum, roosteruur, uur, reserveren.code, naam from reserveren,code,uren where reserveren.code=code.code AND reserveren.uur=uren.tijd AND week='$weeknr' AND jaar='$jaar' Order by lokaal, datum, uur";

    $result1 = mysql_query ($query1);

      while (list ($lokaal, $week, $datum, $roosteruur, $uur, $code,$naam) = mysql_fetch_row($result1)){

    echo "<TR><TD bgcolor=$color>$lokaal</TD><TD>$week</TD><TD bgcolor=$color_day>$dagnaam $datum2</TD><TD bgcolor=$color_day>$roosteruur</TD><TD>$uur</TD><TD>$code</TD><td>$naam</td></TR>";

    }

    But does anyone know a solution to include the empty ones, without having to record them in the database itsself?

    Thanks

  3. I am writing a script in which a test person has to remember a number, that gradually increases in the number of digits, if the tester has remembered the number well. In the <head> there is a redirect to another page after about 7 seconds, where the tester has to fill in the number he/she has just seen. This all works well. But if the answer is wrong, I would like the "redirect" of the page to be stopped. It would look like this:

    if ($answer<>$number) {

    echo ("Sorry, it was the wrong answer; you have managed to remember $series digits in one go.");

    //and here I want the switch out of this page, for within  couple of seconds it will be redirected again!!

    }

    else {

    //here it continues to generate a new, longer, number.

×
×
  • 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.