ֲͲ ò ² Ͳֲ

[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ 14 ] [ 15 ]
[ 16 ] [ 17 ] [ 18 ] [ 19 ] [ 20 ] [ 21 ] [ 22 ] [ 23 ] [ 24 ] [ 25 ] [ 26 ] [ 27 ] [ 28 ] [ 29 ] [ 30 ] [ 31 ] [ 32 ]
[ 33 ] [ 34 ] [ 35 ] [ 36 ] [ 37 ] [ 38 ] [ 39 ] [ 40 ] [ 41 ] [ 42 ] [ 43 ] [ 44 ] [ 45 ] [ 46 ] [ 47 ] [ 48 ] [ 49 ] [ 50 ]

 

4.2

MYSQL
PHP-

: PHP C MySQL.
:

  • .
  • PHP , 볺.
  • .

:

  • PHPMyAdmin, , .

reis SQL-:
CREATE TABLE reis (
reis_id VARCHAR(9) NOT NULL,
ICAO_from VARCHAR(3) NOT NULL,
ICAO_to VARCHAR(3) NOT NULL,
time_from TIME DEFAULT 00:00:00 NOT NULL,
time_to TIME DEFAULT 00:00:00 NOT NULL,
price FLOAT(8) DEFAULT 00000.00 NOT NULL
);
ALTER TABLE reis ADD PRIMARY KEY ( reis_id )
:

  • reis_id ();
  • ICAO_from ICAO , ;
  • ICAO_to ICAO , ;
  • time_from ;
  • time_to ;
  • price .

, , :
CREATE TABLE aport (
ICAO VARCHAR( 3 ) NOT NULL,
name VARCHAR( 20 ) NOT NULL,
PRIMARY KEY ( ICAO )
);
:
reis (ICAO_from ) -> aport (ICAO)
reis (ICAO_to ) -> aport (ICAO).
, ( ).

  • 볺,  2 avia.html. processing.php, , , , , 볺. . 4.1. . 4.8.

4.1
PROCESSING.PHP


<?

/* */

/* 璺 */

$hostname = localhost;

$username = root;

$password = ;

$dbName = avia;

/* */

mysql_connect($hostname,$username,$password) OR DIE( );

/* . - */

mysql_select_db($dbName) or die(mysql_error());

 

/* , ,

,

볺 ($from1 $to1)

reis.ICAO_to = aport.ICAO,

(reis aport) */

$query = SELECT reis.reis_id, reis.ICAO_from,

reis.ICAO_to, aport.name, reis.time_from, reis.time_to, reis.price

FROM reis, aport WHERE reis.ICAO_from = $from1

. 4.1


AND reis.ICAO_to = $to1

AND reis.ICAO_to = aport.ICAO;

 

/* . . */

$res = mysql_query($query) or die(mysql_error());

/* */

$number = mysql_num_rows($res);

/* */

if ($number == 0) {

echo <CENTER><P> </CENTER>;

} else {

/* */

echo <P>ʳ : $number<BR><BR>;

?>

<TABLE BORDER=1>

<TR><TH> </TH><TH> </TH><TH> </TH><TH> </TH>

<TH> </TH><TH> ($)</TH>

</TR>

<?

/* $row, */
while ($row=mysql_fetch_array($res)) {

/* */

echo <TR><TD>.$row[reis_id].</TD><TD>.$row[ICAO_from].

</TD><TD>.$row[ICAO_to]. | .$row[name].

</TD><TD>.$row[time_from].</TD><TD>.$row[time_to].

</TD><TD>.$row[price].</TD></TR>;

}

?>

</TABLE>

<?

}

?>

, 볺 . , . , 볺 , . 볺 , avia.html.  㳿 .

. 4.8.

[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ 14 ] [ 15 ]
[ 16 ] [ 17 ] [ 18 ] [ 19 ] [ 20 ] [ 21 ] [ 22 ] [ 23 ] [ 24 ] [ 25 ] [ 26 ] [ 27 ] [ 28 ] [ 29 ] [ 30 ] [ 31 ] [ 32 ]
[ 33 ] [ 34 ] [ 35 ] [ 36 ] [ 37 ] [ 38 ] [ 39 ] [ 40 ] [ 41 ] [ 42 ] [ 43 ] [ 44 ] [ 45 ] [ 46 ] [ 47 ] [ 48 ] [ 49 ] [ 50 ]


! , . . . / , .
© 2007-2019 BPK Group.