Jump to content
Updating IPB tonight Read more... ×

Archived

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

DaveLinger

Yet again my code echos nothing!

Recommended Posts

[code]<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>[/code]

echos NOTHING; not even my html tags. What gives!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

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.