Ok so I have tried the example and as I'm using mssql and not mysql I have had to change it a bit.
I now have:
$sqlsn = "SELECT system_name FROM tbl_sub_systems WHERE section=\"21a\"";
$rssn = mssql_query( $sqlsn, $conn)
or die ("Cannot execute");
$data = array_chunk(mssql_fetch_array($rssn), 2);
echo "<table border=\"1\">";
foreach ($data as $row)
{
echo "<tr>";
if (count($row)==2)
{
foreach ($row as $n) echo "<td>".$n['system_name']."</td>";
}
else
{
echo "<td colspan=\"2\">".$row[0]['system_name']."</td>";
}
echo "</tr>";
}
echo "</table>";
But it only ever return a count of 2.
So it only creates 1 row of the table which oddly displays the first letter of the first result in each column.
So for instance I have 3 records:
AB
CD
EF
The desired result being
+--------+--------+
| AB | CD |
+--------+--------+
| EF |
+-----------------+
but I am getting
+--------+--------+
| A | A |
+--------+--------+
If the records are:
Z1
Y1
X1
I get:
+--------+--------+
| Z | Z |
+--------+--------+
For starters I don't even understand why it's only displaying the first letter??
I am truly lost.
Many thanks