I have a function that displays a few divs running through a loop using echo but when i put the function in it shows the info where i want it in the table cell but also next to the table
Here is my code
function getTestRows($appName)
{
$implodeArray =array();
$testsql = "SELECT DISTINCT app_instance_name FROM application_instances WHERE application_name ='$appName' AND environment = 'test' ";
$testres = mysql_query($testsql);
if(mysql_num_rows($testres) >=1)
{
while($test = mysql_fetch_array($testres))
{
echo("<div>".$test['app_instance_name']."</div>");
}
}
else
{
echo("<span>No results found</span>");
}
}
and the echo that displays it…
echo("<table id='ver-zebra' style='display: inline-table;'>
<colgroup>
<col class='vzebra-odd' />
<col class='vzebra-even'/>
</colgroup>
<thead>
<th id='appNameHead' OnMouseOver=\"this.style.cursor='pointer';\" onclick=\"openIndiv('$tmp[0]');\">
$tmp[0]
</th>
</thead>
<tbody>
<tr>
<th scope='col' id='test'>
Test
</th>
</tr>
<tr>
<td>
<div style='width: 300px; height: 100px; overflow: auto;'>");
getTestRows($tmp[0]);
echo("</div>
</td>
</tr>

When you call echo, it immediately gets put into the response. Have
getTestRows()return a String which is your HTML instead: