dsaba Posted March 1, 2007 Share Posted March 1, 2007 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 More sharing options...
monk.e.boy Posted March 1, 2007 Share Posted March 1, 2007 //end while function and display searchtableinside $searchtablefooter = <<<EOT </table> EOT; mysql_close(); break; } missing EOT; after the </table> monk.e.boy Link to comment https://forums.phpfreaks.com/topic/40701-solved-something-wrong-with-code/#findComment-196983 Share on other sites More sharing options...
monk.e.boy Posted March 1, 2007 Share Posted March 1, 2007 If I were you I'd replace the <<<EOT asdasdasdasd EOT; with: <?php my_code_here(); ?> <html> <here> <?php my_code_here(); ?> much easier to see what is going on ;) monk.e.boy Link to comment https://forums.phpfreaks.com/topic/40701-solved-something-wrong-with-code/#findComment-196987 Share on other sites More sharing options...
itsmeArry Posted March 1, 2007 Share Posted March 1, 2007 I think you missed an EOT; here $searchtablefooter = <<<EOT </table> it should be $searchtablefooter = <<<EOT </table> EOT; Link to comment https://forums.phpfreaks.com/topic/40701-solved-something-wrong-with-code/#findComment-196989 Share on other sites More sharing options...
dsaba Posted March 1, 2007 Author Share Posted March 1, 2007 thanks a lot people! this always get me, i think its complicated, but its something simple! Link to comment https://forums.phpfreaks.com/topic/40701-solved-something-wrong-with-code/#findComment-196990 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.