I have this code:
<?php $search =$_GET['search']?>
<p>Displaying search results for : <font style="font-weight:bolder;font-style:italic"><?php echo $search?></font></p>
<?php
$mysql_host='localhost';
$mysql_user='root';
$mysql_password='can't see my password..sorry';
mysql_connect($mysql_host,$mysql_user,$mysql_password);
@mysql_select_db('galaxall');
?>
<!--the results-->
<p style="background-color:rgb(250,250,250)">
<div style="background-color:rgb(250,250,250);padding-bottom:3%;margin-right:20%">
<?php
$hello='hello everybody!!!';
$query="SELECT * FROM `galaxall_uploads` WHERE Title LIKE '%$search%' ";
if($is_query_run=mysql_query($query) )
{
while($query_execute=mysql_fetch_assoc($is_query_run) )
{
echo $query_execute ['Title'].'<br>'.''.'<p style="background-color:blue;padding-bottom:5%">'.'<br>' ;
}
} else {
echo"Sorry, something went wrong...";
}
?>
</p>
It is basically an SQL code to retrieve data from a database in an order. Each record when retrieved should be stylised (beautified using CSS). It works well except that the first and the last result are malformed. e.g. the first result is shown without any CSS styling (while the second, third etc are ok) and the last is shown with CSS styling but the result itself is not there.
Screenshot:
As you can see, the first 'ht' has no blue styling and the last has blue styling WITHOUT 'ht' (almost as if they separated from each other)