Jump to content

ARV187

Members
  • Posts

    261
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by ARV187

  1. Hi Vangelis,

    1.- the initial code is made with macromedia dreamweaver.

    mysql_select_db($database_byethost, $byethost);

    $query_Ruta1 = "SELECT `phpvms_pireps`.`pilotid` , `phpvms_pireps`.`accepted` FROM phpvms_pireps WHERE ( ( `phpvms_pireps`.`flightnum` ='HAW1' ) AND ( `phpvms_pireps`.`accepted` =1 ) ) ORDER BY `phpvms_pireps`.`pilotid` ASC LIMIT 0 , 300";

    $Ruta1 = mysql_query($query_Ruta1, $byethost) or die(mysql_error());

    $row_Ruta1 = mysql_fetch_assoc($Ruta1);

    $totalRows_Ruta1 = mysql_num_rows($Ruta1);

    the rest I am trying to do it by myself But not is finished because $ruta2 not work, (pilot 307).

    2- That part is because im very novice in php & mysql. Only know make request to show the data.

  2. Hi all, im trying make a progress tour table. My actual table is showing the results in vertical with this scheme:

    pilotid-nºflight-accepted

    arv187-f1-1

    arv187-f2-1

    arv187-f3-1

    arv220-f1-1

    arv220-f2-1

    arv220-f3-1

    You can see a example here: http://argavirtual.b...la de tours.php

    This is a bad table then i want show results in horizontal mode, as seen in the example image:

    post-5667-0-01321800-1386465429_thumb.jpg

    But not work well, you can see in the first table (vertical table) that pilot id "307" only have complete the first flight "Ruta1"(HAW1), but in the image attachet he have put a "accepted=1" in "Ruta2"(HAW2). This point exceeds my knowledge and im blocked.

    This is the code:

    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
    }
    $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    switch ($theType) {
    case "text":
     $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
     break;
    case "long":
    case "int":
     $theValue = ($theValue != "") ? intval($theValue) : "NULL";
     break;
    case "double":
     $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
     break;
    case "date":
     $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
     break;
    case "defined":
     $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
     break;
    }
    return $theValue;
    }
    }
    mysql_select_db($database_byethost, $byethost);
    $query_Ruta1 = "SELECT `phpvms_pireps`.`pilotid` , `phpvms_pireps`.`accepted` FROM phpvms_pireps WHERE ( ( `phpvms_pireps`.`flightnum` ='HAW1' ) AND ( `phpvms_pireps`.`accepted` =1 ) ) ORDER BY `phpvms_pireps`.`pilotid` ASC LIMIT 0 , 300";
    $Ruta1 = mysql_query($query_Ruta1, $byethost) or die(mysql_error());
    $row_Ruta1 = mysql_fetch_assoc($Ruta1);
    $totalRows_Ruta1 = mysql_num_rows($Ruta1);
    mysql_select_db($database_byethost, $byethost);
    $query_Ruta2 = "SELECT `phpvms_pireps`.`pilotid` , `phpvms_pireps`.`accepted` FROM phpvms_pireps WHERE ( ( `phpvms_pireps`.`flightnum` ='HAW2' ) AND ( `phpvms_pireps`.`accepted` =1 ) ) ORDER BY `phpvms_pireps`.`pilotid` ASC LIMIT 0 , 300";
    $Ruta2 = mysql_query($query_Ruta2, $byethost) or die(mysql_error());
    $row_Ruta2 = mysql_fetch_assoc($Ruta2);
    $totalRows_Ruta2 = mysql_num_rows($Ruta2);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <table border="5" cellpadding="2" cellspacing="2">
    <tr>
    <td>pilotid</td>
    <td>Ruta1</td>
    <td>Ruta2</td>
    <td>Ruta3</td>
    <td>Ruta4</td>
    <td>Ruta5</td>
    <td>Ruta6</td>
    <td>Ruta7</td>
    <td>Ruta8</td>
    <td>Ruta9</td>
    </tr>
    <?php do { ?>
    <tr>
     <td><?php echo $row_Ruta1['pilotid']; ?></td>
     <td><?php echo $row_Ruta1['accepted']; ?></td>
     <td><?php echo $row_Ruta2['accepted']; ?></td>
     <td> </td>
     <td> </td>
     <td> </td>
     <td> </td>
     <td> </td>
     <td> </td>
     <td> </td>
    </tr>
    <?php } while ($row_Ruta1 = mysql_fetch_assoc($Ruta1)); ?>
    
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($Ruta1);
    mysql_free_result($Ruta2);
    ?>
    

    • Like 1
  3. <?php

    error_reporting(E_ALL & ~E_NOTICE);

    $db = mysql_connect('localhost', 'db username goes here', 'db password goes here');

    mysql_select_db('db server name goes here');

    define('NAV_NDB', 2);

    define('NAV_VOR', 3);

    define('NAV_DME', 4);

    define('NAV_FIX', 5);

    Only db server name? not db name?

    Not work to me, in putty I enter the webpage of VA or name server... but i get error network no work time out.

    I find this option:

    post-5667-0-16501200-1386416559_thumb.jpg

  4. See the attached image in first post, in mysql is sorted wrong, because makes a comparison number by number, not by the total amount.For example, with tu154 & extra300, the heavy aircraft is tu154, but he compare digit by digit:

    122000

    1342

    1 & 1 (same number), 2 & 3 (three is greater than two) then sql sort the extra-300 (1342lbs) in second place because in their opinion is greater.

    Only work if i put the same number of digits, For example six digits: Tu-154 (122000) and extra-300 (001342)

  5. Hi all,

    Im trying make a aircraft table, the only part that fault me is order by weight.

    The data not is been order correctly (see image):

    post-5667-0-00854000-1385902478_thumb.jpg

    
    ............ FROM phpvms_aircraft ORDER BY phpvms_aircraft.weight";
    

    Seems that fail is in order number by number and not full cuantity. Ex, order by weight ASC:

    12005324 (the fourth digit is smaller than 3)

    1203 (the fourth digit is bigger than 0)

    The heavier aircraft is ordained as the lightest

    How i can resolve this?

    Thanks, regards...

×
×
  • Create New...