Cod: Selectaţi tot
<?php
$utilizator=mysql_real_escape_string($_GET['matricol']);
$cerereSQL = 'SELECT * FROM studenti WHERE matricol="'.$_GET['matricol'].'"';
$result=mysql_query($cerereSQL);
$num=mysql_num_rows($result);
if ( $num <> 0 )
{
echo '<table border="1" width="450" bgcolor="#8FBEF8" >';
echo '<tr> <th> An Studiu 1 (2008)</th> </tr>';
echo '</tabel>';
echo '<table border="1" width="450" >';
echo '<tr> <th> Disciplina</th> <th> Nota</th></tr>';
$i=0;
while ($i < $num)
{
$rand=mysql_fetch_array($result);
echo '<tr> <td> Fizică</td> <td><center>'.$rand['fizica'].' </td></tr>';
echo '<tr> <td> Analiza şi sinteza dispozitivelor numerice</td> <td><center>'.$rand['asdn'].' </td></tr>';
++$i;
}
}
echo '</tabel>';
?>
Cod: Selectaţi tot
$fizica = $rand['fizica'];
$asdn = $rand['asdn'];
echo '<tr> <td> Media</td> <td><center> average($fizica, $asdn) </td></tr>';