OK, sounds like you want some javascript to change the row's class name on mouseover and mouseout.
Your php and html is a lil strange, but I think what you want is on the line:
$e = '<tr class="rows">';
to change it to something like:
$e = '<tr class="rows" onmouseover="this.className=\'hilite\'" onmouseout="this.className=\'\'">';
and then CSS something like this:
<style type='text/css'>
tr.hilite,
tr.hilite td /* optional, depends on other css */
{
background-color: yellow;
}
</style>