Hello,

I have this code till now:

<?php include '../include/db_viewer.php'; ?>
<?php
$c=$_GET["c"];

$sql="SELECT * FROM regulations AS b LEFT JOIN global AS ab ON b.id=ab.id WHERE checked = '".$c."' ";

$result = mysql_query($sql);

echo "<table class='maxWidth' cellspacing='0'>
<tr><td>
<table cellspacing='0' class='advanced'>
<tr >
<td>Broker</td>
</tr>";
while($row = mysql_fetch_array($result))
  {
echo "<tr>\n";
echo "<td><a href=\"";
echo $row['directory'];
echo  "\" title=\"";
echo $row['short_name'];
echo " Profile \" >";
echo $row['short_name'];
echo "</a></td>";
echo "</tr>\n";

  }
echo "</table>
</td></tr>
</table>";

mysql_close($con);
?>

It should look like this:
<tr> <td> DATA </td></tr>
And i need to add a class: <tr class='bg1'> <td> DATA2 </td></tr>


So when i add the class it display duble data ..

echo "<table class='maxWidth' cellspacing='0'>
<tr><td>
<table cellspacing='0' class='advanced'>
<tr >
<td>Broker</td>
</tr>";
while($row = mysql_fetch_array($result))
  {
echo "<tr>\n";
echo "<td><a href=\"";
echo $row['directory'];
echo  "\" title=\"";
echo $row['short_name'];
echo " Profile \" >";
echo $row['short_name'];
echo "</a></td>";
echo "</tr>\n";

echo "<tr>\n";
echo "<td><a href=\"";
echo $row['directory'];
echo  "\" title=\"";
echo $row['short_name'];
echo " Profile \" >";
echo $row['short_name'];
echo "</a></td>";
echo "</tr>\n";
  }
echo "</table>
</td></tr>
</table>";

It's look like this =

<tr> <td> DATA </td></tr>
<tr class='bg1'> <td> DATA2 </td></tr>
<tr> <td> DATA </td></tr>
<tr class='bg1'> <td> DATA2 </td></tr>

So ho can i display this :

<tr> <td> DATA </td></tr>
<tr class='bg1'> <td> DATA2 </td></tr>

I know that is simple but it's make me crazy...

Like this:

<tr> <td> DATA </td></tr>
<tr class='bg1'> <td> DATA2 </td></tr>
<tr> <td> DATA3 </td></tr>
<tr class='bg1'> <td> DATA4 </td></tr>
.....
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.