Hello there,
I'm having some weird troubles with my script. I'm using a MS access database and the scripts that takes the data from the DB has some strange and alternating results.
In 25% of the cases it brings out the data just fine in a table and the other times the page cannot be found, or the table is wrong with colored cells en data outside the table and other weird stuff.
This is the code i'm using
<?php
$conn=odbc_connect('starmakertest2','','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
$sql="SELECT Id1,NAAMPAKKET,APLICATIEBEHEERDER,FUNCTIONEELBEHEERDER,GROEP,INGEBRUIK FROM starmaker1test ORDER BY GROEP";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table align=center width=100% bgcolor=#33cccc border=1 cellpadding=5 ><tr>";
echo "<th bgcolor=\"#339999\" ><font color=\"#ffffff\">EIGENAAR</font></th>";
echo "<th bgcolor=\"#339999\" ><font color=\"#ffffff\">ID NUMMER</font></th>";
echo "<th bgcolor=\"#339999\" ><font color=\"#ffffff\">NAAM PAKKET</font></th>";
echo "<th bgcolor=\"#339999\" ><font color=\"#ffffff\">APPLICATIE BEHEERDER</font></th>";
echo "<th bgcolor=\"#339999\" ><font color=\"#ffffff\">FUNCTIONEEL BEHEERDER</font></th>";
echo "<th bgcolor=\"#339999\" ><font color=\"#ffffff\">IN GEBRUIK</font></th></tr>";
while (odbc_fetch_row($rs))
{
$eigenaar=odbc_result($rs,"GROEP");
$trimeigenaar = trim($eigenaar,"");
$idnummer=odbc_result($rs,"Id1");
$trimidnummer = trim($idnummer,"");
$naampakket=odbc_result($rs,"NAAMPAKKET");
$trimnaampakket = trim($naampakket,"");
$app_beheerder=odbc_result($rs,"APLICATIEBEHEERDER");
$trimapp_beheerder = trim($app_beheerder,"");
$funct_beheerder=odbc_result($rs,"FUNCTIONEELBEHEERDER");
$trimfunct_beheerder = trim($funct_beheerder,"");
$ingebruik=odbc_result($rs,"INGEBRUIK");
if ($trimeigenaar == "") echo "<tr><td bgcolor=\"#ffffff\" > </td>";
else
echo "<tr><td bgcolor=\"#ffffff\" >$trimeigenaar</td>";
if ($trimidnummer == "") echo "<td bgcolor=\"#ffffff\" > </td>";
else
echo "<td bgcolor=\"#ffffff\" >$idnummer</td>";
if ($trimnaampakket == "") echo "<td bgcolor=\"#ffffff\" > </td>";
else
echo "<td bgcolor=\"#ffffff\" >$naampakket</td>";
if ($trimapp_beheerder == "") echo "<td bgcolor=\"#ffffff\" > </td>";
else
echo "<td bgcolor=\"#ffffff\" >$app_beheerder</td>";
if ($trimfunct_beheerder == "") echo "<td bgcolor=\"#ffffff\" > </td>";
else
echo "<td bgcolor=\"#ffffff\" >$funct_beheerder</td>";
if ($ingebruik == "") echo "<td bgcolor=\"#ffffff\" > </td></tr>";
else
echo "<td bgcolor=\"#ffffff\" >$ingebruik</td></tr>";
}
?>
<?php
odbc_close($conn);
echo "</table>";
?>
I hope someone can help me cause this aint no fun anymore😉
By the way, the problem only seems to arise when the result stack is big. (+/-300 records)