Ricapitolando, il codice ora è questo:
Codice PHP:
<?php
error_reporting (E_ALL);
include("data.php");
$conn = mysql_connect($dbhost, $user, $password) or die ('Error connecting to mysql');
mysql_select_db($database, $conn) or die('Error while selecting DB');
$sql = "SELECT max(CodVer) as massimo FROM Releases";
$result = mysql_query ( $sql ) or die("Errore nella selezione: " . mysql_error());
$row = mysql_fetch_array( $result );
$max = $row['massimo'];
$sql2 = "SELECT * FROM Releases WHERE codVer = $max";
//$query = 'SELECT * FROM Releases WHERE CodVer in (SELECT MAX(CodVer) FROM Releases)';
//$result = mysql_query($query) or die(mysql_error());
$result = mysql_query($sql2) or die(mysql_error());
while($row = mysql_fetch_row($result))
{
echo $row['CodVer'];
echo $row['NumVer'];
echo $row['Description'];
}
mysql_close($conn);
?>
Mi sono usciti fuori questi errori:
Codice PHP:
Notice: Undefined index: CodVer in /home/groups/g/go/gootor/htdocs/update.php on line 15
Notice: Undefined index: NumVer in /home/groups/g/go/gootor/htdocs/update.php on line 16
Notice: Undefined index: Description in /home/groups/g/go/gootor/htdocs/update.php on line 17
Avete qualche suggerimento?