let's see here
we have a database with quite a lot of records
1 course per record and per record multiple places where the course will be held
but not every place has a value and I want to exclude empty fields
the script is as follows, field names are in dutch in case you're wondering which strange language that is :-)
in asp with access this is no problem at all, but how does thie work in php?
I do not want to get the field instapproef printed for instance and no value in it
I also don't want if statements because that creates empty fields
I hope you'll understand what I mean
The problem is the html code within the array.
<?php
mysql_connect (localhost, xxxx, xxxx);
mysql_select_db (xxxxx);
$result = mysql_query ("SELECT * FROM lang0506
WHERE id LIKE '$id'
");
if ($row = mysql_fetch_array($result)) {
do {
echo "<b><center><font size=2>";
echo $row["titel"];
echo "<br>";
echo "<hr align=\"center\" width=\"100%\" size=\"1\" noshade color=\"#000000\">";
echo "<a href=\"http://www.syntra-ab.be/downloadfolderlang.php?id=$row[id]\">";
echo "download folder";
echo "</a>";
echo " - <a href=\"http://www.syntra-ab.be/mailfolderlang.php?id=$row[id]\">";
echo "mail folder";
echo "</a>";
echo " - <a href=\"http://www.syntra-ab.be/cgi-bin/birdcast.cgi\">stuur naar vriend</a>";
echo " - <a href=\"http://www.syntra-ab.be/sector.php?sectorid=$row[sectorid]\">terug naar sector</a></b></center></font>";
echo "<hr align=\"center\" width=\"100%\" size=\"1\" noshade color=\"#000000\"><br<<br>";
echo ("<br><br>");
echo ("<b class=red>");
echo ("Waarom deze opleiding? ");
echo ("</b>");
echo ("<br><br>");
echo $row["teaser"];
echo ("<br><br>");
echo ("<b class=red>");
echo ("Voor wie?? ");
echo ("</b>");
echo ("<br><br>");
echo ("<b>Doelgroep</b><br><br>");
echo $row["doelgroep"];
echo ("<br><br>");
echo ("<b>Toelatingsvoorwaarden</b><br><br>");
echo $row["toelating"];
echo ("<br><br>");
echo ("<b>Instapproef</b><br><br>");
echo $row["instapproef"];
echo ("<br><br>");
echo ("<b class=red>");
echo ("Hoelang duurt deze opleiding? ");
echo ("</b>");
echo ("<br><br>");
echo $row["aantal_jaren"];
echo ("<br><br>");
echo ("<b class=red>");
echo ("Practische gegevens ");
echo ("</b>");
echo ("<br><br>");
} while($row = mysql_fetch_array($result));
} else {print "Sorry, geen records gevonden!";}
?>