Jump to content

[SOLVED] something wrong with code?


dsaba

Recommended Posts

I have a script that processes a searchterm and pulls up a search results table

i have isolated each major chunk of code to see where the problem is, and have figured out that somewhere in the block of code, it causes the page to be blank, and nothing happen

 

so is there anything wrong with this piece of code?

I hypthosize that its something to do with brackets on the switch and while statement

 

switch ($resultcount)
{
  case "0" : 
echo "Sorry no results for your search, request a file here";
mysql_close();
     break;
  default :
$searchtableheader = <<<EOT
<table width="760px" align="center" cellpadding="0" cellspacing="2" class="main">
  <tr>
    <td class="content"><br />
        <div class="titulares style1">Results for:<em> $searchterm </em>($resultnumber)</div>
        <table  border="0" cellpadding="0" cellspacing="1" align="center" width="760px">
        <tr>
          <td colspan="5"> </td>
        </tr>
        <tr>
          <td width="33%" class="similares">Name</td>
          <td width="12%" class="similares">Mirrors</td>
          <td width="21%" class="similares">Date</td>
          <td width="20%" class="similares">Type</td>
          <td width="14%" class="similares">Submitter</td>
        </tr>
EOT;
echo $searchtableheader;
/////////end display searchtableheader 
     while ($searchqueryrow = mysql_fetch_array($searchquery)) {
$filelink = $searchqueryrow['filelink'];
$filetotalmirrors = $searchqueryrow['filetotalmirrors'];
$filegeneraltype = $searchqueryrow['filegeneraltype_en'];
$filedateadded = $searchqueryrow['filedateadded'];
$filesubmitter = $searchqueryrow['userlink'];

$searchtableinside = <<<EOT
        <tr>
          <td class="nombre">$filelink</td>
          <td class="nombre">$filetotalmirrors</td>
          <td class="fecha">$filedateadded</td>
          <td class="descargas">$filegeneraltype</td>
          <td class="descargas">$filesubmitter</td>
        </tr>
EOT;
echo $searchtableinside;
}
//end while function and display searchtableinside
$searchtablefooter = <<<EOT
      </table>
mysql_close();
     break;
}

Link to comment
https://forums.phpfreaks.com/topic/40701-solved-something-wrong-with-code/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.