It looks like you don't really need to exit out of the PHP tag on this one.
<?php
$akhbarkotah1 = $conn->prepare("SELECT text,time FROM small WHERE active='0' ORDER BY time DESC LIMIT 10");
$akhbarkotah1->execute();
while($obj = $akhbarkotah1->fetch(PDO::FETCH_OBJ)){
echo "<div>" . $obj->text . "</div>";
}
?>
This simplifies the code and shortens it. I think that I have the Syntax Correct. I am rather new to PHP myself but I am pretty sure that this will work exactly the same.
If you leave your code the other way you should indent the HTML to match what is inside the PHP since it is really inside the PHP (kind of/sort of) like this
<?php
$akhbarkotah1 = $conn->prepare("SELECT text,time FROM small WHERE active='0' ORDER BY time DESC LIMIT 10");
$akhbarkotah1->execute();
while($obj = $akhbarkotah1->fetch(PDO::FETCH_OBJ)){
?>
<div><?php echo $obj->text; ?></div>
<?php
}
?>
I personally don't like the way that this looks though.