Look at the code and explain me what kills the output!
I repeat the same SQL instruction and i receive results!
Check out:
Code: Select all
<?php
//αρκικοποιήσεις μεταβλητών για να μην έχουμε φαινόμενα undef var
$id[0]='';
$cpu[0]='';
$ram[0]='';
$motherboard[0]='';
$lancard[0]='';
$utp[0]='';
$ip[0]='';
$vgacard[0]='';
$soundcard[0]='';
$speakers[0]='';
$keyboard[0]='';
$mouse=[0]='';
$monitor[0]='';
$motherboard_report[0]='';
$lancard_report[0]='';
$vgacard_report[0]='';
$soundcard_report[0]='';
$speakers_report[0]='';
$keyboard_report[0]='';
$mouse_report[0]='';
$monitor_report[0]='';
$software[0]='';
function displayResults($result,$counterA,$id,$cpu,$ram,$motherboard,$lancard,$utp,$ip,$vgacard,$soundcard,$speakers,$keyboard,$mouse,$monitor,$motherboard_report,$lancard_report,$vgacard_report,$soundcard_report,$speakers_report,$keyboard_report,$mouse_report,$monitor_report,$software)
{
$counter=0;//metritis 5adwn gia na bgainoun 5ades
$semaphore=0;//simaforos wste na kseroume an prepei na mpei </tr> sto telos
printf("<table border="0">");
if($counter==0)
{
printf("<tr>");
}
for( $i=0;$i<$counterA;$i++ )
{
echo'<td>';
echo'<table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><p>ID:'.$id[$i].'</p>
<p>UTP:'.$utp[$i].'</p>
<p>IP:'.$ip[$i].'</p>
<p>CPU:'.$cpu[$i].'</p>
<p>RAM:'.$ram[$i].'</p>
<p>Motherboard:'.$motherboard[$i].'</p>
'.if(strlen($motherboard_report[$i])>0)
{
echo '<p>'.$motherboard_report[$i].'</p>';
}.'
<p>LANcard:'.$lancard[$i].'</p>
'.if(strlen($lancard_report[$i])>0)
{
echo '<p>'.$lancard_report[$i].'</p>';
}.'
<p>Soundcard:'.$soundcard[$i].'</p>
'.if(strlen($soundcard_report[$i])>0)
{
echo '<p>'.$soundcard_report[$i].'</p>';
}.'
<p>Keyboard:'.$keyboard[$i].'</p>
'.if(strlen($keyboard_report[$i])>0)
{
echo '<p>'.$keyboard_report[$i].'</p>';
}.'
<p>Mouse:'.$mouse[$i].'</p>
'.if(strlen($mouse_report[$i])>0)
{
echo '<p>'.$mouse_report[$i].'</p>';
}.'
<p>Monitor:'.$monitor[$i].'</p>
'.if(strlen($monitor_report[$i])>0)
{
echo '<p>'.$monitor_report[$i].'</p>';
}.'
<p>Αναφορά Software:</p>
<p>'.$software[$i].'</p>
<form name="form1" method="post" action="update.php?id='.$id[$i].'">
<div align="center">
<input name="submit" type="submit" id="submit" value="Update Info">
</div>
</form>
</td>
</tr>
</table>';
echo'</td>';
$counter++;//mh to mpeurdeueis me to $counterA
if($counter==3)
{
printf("</tr>");
$semaphore=1;
$counter=0;
}
}// telos for
if($semaphore==0)
{
printf("</tr>");
}
printf("</table>");
###############################################################################################################################################
# if($counterA>=15)
# {
# printf("<br><br><strong><font color="#000000" size="2" face="Arial">Σελίδες αποτελεσμάτων: [ </font></strong>");
# $y=0;
# for($z=$counterA;$z>0;$z-=15)
# {
# $y++;
# printf("<a href="view_all_page2.php?step=0&choice=%s&id=%s&z=%s" style="text-decoration: none"><strong><font color="#ffffff" size="2" face="Arial">%s </font><strong></a>", $choice ,$id , $z , $y); //to $id einai to eidos anazitiseis, to $z einai o header pou deixnei apo poia eggrafi arxizoume
# }
# printf("]");
# }//telos if($counterA
###############################################################################################################################################
}//telos function
require_once ("../../ww/connect.inc");
$query = "SELECT * FROM workstations";
$result = mysql_query ($query) or die("Αδυναμία εκτέλεσης ερωτήματος");
$counterA=0;//metritis stis array
while ($row = @ mysql_fetch_array($result))
{
$counterA++;//apo8ikeuw ola ta onomata se pinaka 1 x $counterA
$id[$counterA]=$row['id'];
$cpu[$counterA]=$row['cpu'];
$ram[$counterA]=$row['ram'];
$motherboard[$counterA]=$row['motherboard'];
$lancard[$counterA]=$row['lancard'];
$utp[$counterA]=$row['utp'];
$ip[$counterA]=$row['ip'];
$vgacard[$counterA]=$row['vgacard'];
$soundcard[$counterA]=$row['soundcard'];
$speakers[$counterA]=$row['speakers'];
$keyboard[$counterA]=$row['keyboard'];
$mouse=[$counterA]=$row['mouse'];
$monitor[$counterA]=$row['monitor'];
$motherboard_report[$counterA]=$row['motherboard_report'];
$lancard_report[$counterA]=$row['lancard_report'];
$vgacard_report[$counterA]=$row['vgacard_report'];
$soundcard_report[$counterA]=$row['soundcard_report'];
$speakers_report[$counterA]=$row['speakers_report'];
$keyboard_report[$counterA]=$row['keyboard_report'];
$mouse_report[$counterA]=$row['mouse_report'];
$monitor_report[$counterA]=$row['monitor_report'];
$software[$counterA]=$row['software'];
}
displayResults($result,$counterA,$id,$cpu,$ram,$motherboard,$lancard,$utp,$ip,$vgacard,$soundcard,$speakers,$keyboard,$mouse,$monitor,$motherboard_report,$lancard_report,$vgacard_report,$soundcard_report,$speakers_report,$keyboard_report,$mouse_report,$monitor_report,$software);
?>I can expect wrong output or some mistakes but not a blank page!