0

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...

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by artvor
0

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>
.....
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.