Jump to content


Photo

Yet again my code echos nothing!


  • Please log in to reply
2 replies to this topic

#1 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 01 August 2006 - 02:58 AM

<html>
<body>
<head>
<link href="resultcss.css" rel="stylesheet" type="text/css" />
</head>
<?php
include('config/file.php');

$platform = $_POST['platform'];
$developer = $_POST['developer'];
$publisher = $_POST['publisher'];
$fletter = $_POST['fletter'];
$sortby = $_POST['sort'];
$perpage = $_POST['perpage'];
$order = $_POST['order'];

if (!$link = mysql_connect($sqlserver, $sqlusername, $sqlpassword)) {
   echo 'Could not connect to mysql';
   exit;
}

if (!mysql_select_db($sqldatabase, $link)) {
   echo 'Could not select database';
   exit;
}

if($fletter == '%'){
$query="SELECT * FROM nuke_seccont WHERE secid LIKE '$platform' AND developer LIKE '$developer' AND publisher LIKE '$publisher' ORDER BY $sortby $order";
}ELSE{
$query="SELECT * FROM nuke_seccont WHERE secid LIKE '$platform' AND developer LIKE '$developer' AND publisher LIKE '$publisher' AND fletter='$fletter' ORDER BY $sortby $order";
}
$result = mysql_query($query) or die("Problem with the query: $query<br>" . mysql_error());

mysql_close();

$numberofresults = mysql_num_rows($result);

if($numberofresults == '0'){
echo "No results found matching the criteria specified!";
}else{
echo "<p align=\"left\">Search successful! $numberofresults results found.</p>";
echo "<table width=\"100%\" height=\"100%\"><tr><td>Game Title</td><td>Final Score</td><td>Author</td><td>Platform</td><td>Release Date</td><td>Publish Date</td><td>Hits</td></tr>\"

$i=0;
while ($i < $numberofresults) {

$query2="SELECT * FROM nuke_sections WHERE secid = $platform";
$result2 = mysql_query($query2) or die("Problem with the query: $query2<br>" . mysql_error());

mysql_close();

while ($row = mysql_fetch_array($result2)) {

$section = stripslashes($row["secname"]);

}

$aid=mysql_result($result,$i,"aid");
$artid=mysql_result($result,$i,"artid");
$secid=mysql_result($result,$i,"secid");
$title=mysql_result($result,$i,"title");
$counter=mysql_result($result,$i,"counter");
$score6=mysql_result($result,$i,"score6");
$releasedate=mysql_result($result,$i,"releasedate");
$publishdate=mysql_result($result,$i,"publishdate");

echo "<tr><td>● <a href=\"review.php?artid=$artid\" target=\"_parent\"><b>$title</b></a></td>$score6<td></td><td>$aid</td><td>$section</td><td>$releasedate</td><td>$publishdate</td><td>$counter</td></tr>";

$i++;
}
echo "</table>"
}
?>
</body>
</html>

echos NOTHING; not even my html tags. What gives!
http://www.DaveLinger.com
dave at linger dot com

#2 bpops

bpops
  • Members
  • PipPipPip
  • Advanced Member
  • 232 posts

Posted 01 August 2006 - 03:08 AM

I dont know if this is the problem, but typically you should put the <head> tags before the <body> tag, not within it.

Could you try that while I read the rest of this code? :) I'll reply again soon.

#3 bpops

bpops
  • Members
  • PipPipPip
  • Advanced Member
  • 232 posts

Posted 01 August 2006 - 03:12 AM

note that your second echo command
echo "<table width=\"100%\" height=\"100%\"><tr><td>Game Title</td><td>Final Score</td><td>Author</td><td>Platform .......................

is never ended. You need to end that echo before going on to the rest of the php.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users