pls change
$result3 = @mysql_query("select * from table1, table2 where table1.ID = table2.v_id and table1.pro_id = '" . $FID . "'");
into
$result3 = @mysql_query("select * from table1, table2 where table1.ID = table2.v_id and table1.pro_id = '" . $FID . "' ORDER BY table1.ID,table2.v_id");
for displaying:
$oldID='';
$q=mysql_query( "select * from table1, table2 where table1.ID = table2.v_id and table1.pro_id = '" . $FID . "' ORDER BY table1.ID,table2.v_id");
while( $line=mysql_fetch_array( $q ) )
{
if ( $line[ 'ID' ] != $oldID )
{
echo '<h1>'.$line[ 'prod_version' ].'</h1>'; // show header here
}
echo "<p>$line['software_version'] ". " <a href ='CL_changelog.php? software_version=$line['ID']'> " . " ChangeLog</a></p>".'<br />';// all infos for subtitle here
$oldID=$line[ 'ID' ];
}