I've just posted a problem and it was solved however now i've got another problem with displaying the solution Oh and i'm still a newbie!
Right, i've got a loop which SHOULD display columns and records from a table. In a format like this for each record:
Name: Blah
Age: Bleh
It does this fine for the first record but for the 2nd record it only has the cell so its showing like this:
: Blah
: Bleh
Hope someone has the solution thanks either way
$sql = "SELECT * FROM $chosencollection";
$result = mysql_query($sql);
$result2 = mysql_query($sql);
$cols_num = mysql_num_fields($result2);
?>
<h1>View Collection</h1>
<?
echo "<p><h2>" . $collectionnametitle ."</h2></p>";
while($row = mysql_fetch_row($result))
{
foreach($row as $cell)
{
$col = mysql_fetch_field($result2);
$col->name = str_replace("_", " ", $col->name);
echo "<b>{$col->name}</b>: $cell<br>";
}
echo "<br>";
}