Potreste controllarmi e correggermi la condizione else , perche' mi stampa soltanto $nome e non gli obj . Grazie Dwayn


include "db_details.php";
if (mysql_connect($mysql_hostname, $mysql_username, $mysql_password)) {
if (@mysql_select_db($db_name)) {
$result = mysql_query("SELECT * FROM tabella1 where nomi= '$nome'");
if ($obj = mysql_fetch_object($result)) {
echo '<p class="colleg">'. $obj->campo1.'</p>
';
echo '<h1><p class="colleg">'.$nome.'</p></h1>
';
echo '<h2><p class="colleg">'. $obj->campo2.'</p></h2>
'; }
else $result = mysql_query("SELECT * FROM tabella1 where nomi= '$nome' ORDER BY rand() LIMIT 1");
{
echo '<p class="colleg">'. $obj->campo1.'</p>
';
echo '<h1><p class="colleg">'.$nome.'</p></h1>
';
echo '<h2><p class="colleg">'. $obj->campo2.'</p></h2>
'; }
echo("
");