I am trying to display the data from two columns in a database table inside a textarea in php, under the headings tag number and scc
It should read something like this.
However it reads all in one line with no breaks and it looks messy:
Here is my code, I would appreciate some advice on how to structure this in a table format or something neat. The lines in bold are were I have displayed the two columns data in the textarea. $MyText1 & $Out1 displays the data in the textarea.
// mysqli_fetch_assoc
$myquery = "SELECT `scc`, `tag_number` FROM `milk`
";
$result = mysql_query($myquery);
$MyText = "";
$MyText1 = "";
//$row = mysql_fetch_array($result);
while ($row = mysql_fetch_array($result))
{
$Scc = $row['scc'];
$TagNumber= $row['tag_number'];
//$MyText.= $row['tag_number'];
$MyText .= $TagNumber . ', ';
***$MyText1 .= $TagNumber . $Scc . ',';***
***$msg1 = "TagNumber : Scc : " .$row[0].$row[1];***
// $out1 = '<p align="left"><textarea rows="5" cols="25" disabled = "true">' .$msg1. '</textarea></p>';
//mysqli_fetch_array($result)
// echo $out1;
if($row['scc'] > 50 ) {
$msg = ("'Somanic cell count levels are meeting the expected output levels in the herd.' $MyText. 'are above the average' 'No further action should be taken according to current production levels '");
//$msg = $TagNumber;
//echo $row.$TagNumber;
}
elseif ($Scc < $average) {
$msg = 'SCC levels are below the average.';
}else{
$msg = 'some other message';
}
}
***$out1 = '<p align="left"><textarea rows="5" cols="25" disabled = "true">'.$msg1.$MyText1. '</textarea></p>';***
//mysqli_fetch_array($result)
***echo $out1;***