Hi, I am using MS Access to hold the data and PHP to collect the data from the database and display it on a website.
I've got the results displaying in the normal way with data being displayed in a linear manner e.g.
Title 1 - Title 2 - Title 3 - Title 4 - Title 5
Output1 - Output1 - Output1 - Output1 - Output1
Output2 - Output2 - Output2 - Output2 - Output2
Output3 - Output3 - Output3 - Output3 - Output3
etc
What I want to be able to do is, have the table sorted in a non-linear manner whereby info can be displayed in whatever format I need with the results repeating like normal e.g.
Title 1 Title 2
Output1 Output1
Title 3
Output1
Title 4 Output1
Title 5 Output1
Title 2 Title 2
Output2 Output2
Title 3
Output2
Title 4 Output2
Title 5 Output2
etc, so the Outputs from the first Row are displayed in whatever layout I choose and that layout is repeated for the results following it.
With the normal way (linear) I just create a table and the rows are generated. What I need to know is, it there a way to move away from that way of displaying the data? Can it be displayed in a non linear way, so the data still repeats but in a customized table? And if it is possible could you post the coding for it or how to go about making it work.
I'm only a beginner to PHP have only been using it about 2 weeks now, so will need some things clarifying in some detail so I can google or find out about them if I don't understand.
Heres my coding for the original one - the linear results.
<?php
$conn=odbc_connect("database","" ,"");
print('<html>
<head>
<title>Test</title>
</head>');
print('<body>');
print('<table align=center width=90%>');
print('<tr><th>Title1</th><th>Title2</th><th>Title3</th>
<<th>Title4</th><th>Title5</th><th>Title6</th><th>Title7</th>
<th>Title8</th><th>Title9</th><th>Title10</th><th>Title11</th></tr>');
if($conn)
{
$sql="select * from testtable";
$row=odbc_exec($conn, $sql);
while(odbc_fetch_row($row))
{
$Title1=odbc_result($row,1);
$Title2=odbc_result($row,2);
$Title3=odbc_result($row,3);
$Title4=odbc_result($row,4);
$Title5 =odbc_result($row,5);
$Title6 =odbc_result($row,6);
$Title7 =odbc_result($row,7);
$Title8 =odbc_result($row,8);
$Title9 =odbc_result($row,9);
$Title10 =odbc_result($row,10);
$Title11 =odbc_result($row,11);
print('<tr><td>'.$result1.'</td><td>'. $result2.'</td><td>'.$result3.'</td><td>'.$result4.'</td><td>'.$result5.'</td><td>'.$result6.'</td><td>'. $result7.'</td><td>'.$result8.'</td><td>'.$result9.'</td><td>'.$result10.'</td><td>'.$result11.'</td></tr>');
}
}
print('</table>');
print('</body>');
print('</html>');
Any help would be appreciated.
Thanks.