SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    AK
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Number of Records displayed

    Hi all,

    I have a form that has been running flawlessly on a PHP web site until today. I finally figured out what is wrong but don't know how to fix it yet. I have a form that displays records from a MySQL database based on certain criteria. You can select one of those records and that selected data will be forwarded to another form and so on until completion. Well today I went over 94 records displayed and the submit button and/or ENTER key quit working, the form will not execute and I don't see any errors, it just sits there. I deleted a record to get the count below 95 and it works fine again. I can't find anywhere in my coding where I put a limit on the amount of records displayed. Any ideas why this may be happening? I'd send you some code but not sure what to send otherwise I may be able to figure it out if I knew where the problem is.

    Thanks in advance,
    Lyle

  2. #2
    SitePoint Guru aamonkey's Avatar
    Join Date
    Sep 2004
    Location
    kansas
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no way to tell without seeing some code :-)

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    AK
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Like I said earlier I'm not sure whaere the problem lies so here is the whole page:

    PHP Code:
    <?
    include ("header.php");
    //LDK - get pilot id
    $me $_COOKIE['vadmin_myid'];
    $sql3 "select vadminid, hub from pilot where id = '$me'";
    $sth3 mysql_query($sql3);
    list ( 
    $pilot_number$HomeHub) = mysql_fetch_array($sth3);

    //Finds number of selected routes
    $sql9="select ActiveRotation from routes where vadminid='$pilot_number'"
    $result=mysql_query($sql9); 
    $num_row=mysql_num_rows($result); 
    $NoRots=0;

    $RS $_GET['RouteSequence'];
    $DepIcao1 $_GET['rotation'];
    $DepIcao $_GET['DepIcao'];
    $AcType $_GET['AcType'];
    $A_Time1 $_GET['ArrivalT'];
    $aircraft1 $_GET['TheAircraft'];

    if (
    $HomeHub == $DepIcao1){
    echo 
    "
    <html>\n
    <head>\n
    <meta http-equiv=\"Refresh\" content=\"0;url="
    .$urlpath."listrotations.php\">
    </head>\n
    <body>\n
    </body>\n
    </html>\n"
    ;
    }else{
    //Selects routes not activated with an "A"
    $sql2 "select routename, depart_code, PushBack, arrive_code, Parked, aircraft, DST, BlkTime from routes where ActiveRotation NOT REGEXP 'A' AND deleted <> 1";
    if (
    $DepIcao1 != "")
    $sql2 .= " AND depart_code = '$DepIcao1'";
    if (
    $DepIcao != "")
    $sql2 .= " AND depart_code = '$DepIcao'";
    if (
    $ArrIcao != "")
    $sql2 .= " AND arrive_code = '$ArrIcao'";
    if (
    $AcType == "1")
    $sql2 .= " AND aircraft IN ('B190','B737','CRJ2')";
    elseif (
    $AcType == "2")
    $sql2 .= " AND aircraft IN ('B190','B737','CRJ2','A320')";
    elseif (
    $AcType == "3")
    $sql2 .= " AND aircraft IN ('B190','B737','CRJ2','A320','MD83')";
    elseif (
    $AcType == "4")
    $sql2 .= " AND aircraft IN ('B190','B737','CRJ2','A320','MD83','B763')";
    elseif (
    $AcType == "5")
    $sql2 .= " AND aircraft IN ('B190','B737','CRJ2','A320','MD83','B763','B744')";
    $sql2 .= " order by aircraft, PushBack, BlkTime, arrive_code"
    $sth2 mysql_query($sql2);

    $results '';
    $results .= "<table width = 640 table border = 0 cellspacing = 2 bgcolor = \"#cccccc\" >";
    $results .="<tr>
    <th>FLT</th>
    <th>ORG</th>
    <th>DEP</th>
    <th>DES</th>
    <th>ARR</th>
    <th>EQP</th>
    <th>DIST</th>
    <th>BLK</th>
    <th>HOP</th>"
    ;
    $results .= "</tr>";
    $count 0;
    while ( list(
    $routename$dep_code$D_Time$arrive_code$A_Time$aircraft$dist$time) = mysql_fetch_array($sth2)) {

    $sql4 "select airport_code from airport_data where airport_code='$dep_code'";
    $sth4 mysql_query($sql4);
    list ( 
    $depart_code) = mysql_fetch_array($sth4);

    $sql5 "select airport_code from airport_data where airport_code='$arrive_code'";
    $sth5 mysql_query($sql5);
    list ( 
    $arrive_code) = mysql_fetch_array($sth5);

    $results .="<tr align=\"center\" bgcolor =\"#ccccdd\" onMouseOver=\"changeNav(this,'#FFFFFF');\" onMouseOut=\"changeNav(this,'#ccccdd');\">";
    $results .= "<td>".$routename."</td> 
    <td>"
    .$depart_code."</td>
    <td>"
    .$D_Time."</td>
    <td>"
    .$arrive_code."</td>
    <td>"
    .$A_Time."</td>
    <td>"
    .$aircraft."</td>
    <td>"
    .$dist."</td>
    <td>"
    .$time."</td>";
    $results .= "<td> <form action=\"MakeRotation.php\" method=\"GET\"><input type=\"hidden\" name=\"search_type\" value=\"rotation\"><input type=\"radio\" name=\"rotation\" value=\"$arrive_code&$routename&$pilot_number&$AcType&$RS&$A_Time&$aircraft\"> </td>";
    $results .= "</tr>";
    $count ++;
    }
    $results .= "</table>";

    if (
    $count == '0') {
    echo 
    "There were no results from your search.<br/>";
    } else {

    echo 
    "<table width = 640 table border = 0 cellspacing = 2 bgcolor = \"#cccccc\">";

    echo 
    "<tr><td>Here are $count available hops sorted by Aircraft Type and Departure Time. Only the Aircraft that you are \"RATED\" to fly will be displayed. The first Departure Airport will be your Home Base and then your Arrival Airport until you arrive back at your Home Base. Select the hop you would like to add to your Rotation then press the \"Enter Key\" or click on \"Next Hop\". Continue selecting hops until you reach your Home Base or select the \"List Rotation\" link to see what you have so far. Once you have selected a route that has a destination of your Home Base, you will then be sent to the List Rotation page to complete the process.<br></br>";

    if(
    $NoRots==$num_row){
    } else {
    echo 
    "<span style=\"color: red;\">Your last hop has you arriving $DepIcao1 at $A_Time1 in a $aircraft1.</span></td></tr>";
    }

    echo 
    $results;
    }

    echo 
    "</table>";
    echo 
    "<input type=\"submit\" value=\"Next Hop\">";
    echo 
    "</form>";
    }
    include (
    "footer.php");
    ?>
    The selected line of data is used to redisplay this form with a different set of records based on the first selection.

    Thanks for any help,
    Lyle


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •