Jump to content


Photo

Need help displaying certain selection


  • Please log in to reply
2 replies to this topic

#1 thechris

thechris
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 01 October 2006 - 11:02 AM

Problem: I have the alphabetical navigation done and it displays and when I test this in a browser it will change the $Key in the URL field of the browser but what it won't do is just display the titles of the anime that start with the letter that is the key letter.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>iAnime Downloads</title>
<link href="Styles/basic.css" rel="stylesheet" type="text/css">
<link href="Styles/nav.css" rel="stylesheet" type="text/css">
<link href="Styles/menu.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {color: #FFFFFF}
-->
</style>
</head>

<body>
<div id="wrapper">
	<div id="titlebar"><img src="Images/ban.png"></div>
	<div id="nav">
		<ul>
			<li><a href="home.php">Home</a></li>
		    <li><a href="downloads.php">Downloads</a></li>
		    <li><a href="forum.php">Forums</a></li>
		    <li><a href="support.php">Support</a></li>
		    <li><a href="ianime.php">iAnime</a></li>
		</ul>
	</div>
	<div id="top"><img src="Images/top.png"></div>
	<div id="main content">
		<div id="alphabet">
<?php
$Key = $_REQUEST['Key'];

if (!$Key) {
  $ASCII= 65; # uppercase (+32 for lowercase)
  $i = 1;
  while ($i < 27) {
    $Char = chr($ASCII);
    echo("<a href='?key=$Char'>$Char</a>");
    if($i < 26) {
     echo(" - ");
    }
    $i++;
    $ASCII++;
  }
} else {
  $SQL = sprintf("SELECT `anime_name` FROM `Videos` WHERE `anime_name` LIKE `%s*`", $Key);
}
?>
		</div>
		<div id="list"><center>
<?php require_once('Connections/connectDB.php'); ?>
<?php
mysql_select_db($database_connectDB, $connectDB);
$query_Recordset1 = "SELECT anime_name, type FROM Videos WHERE anime_name LIKE '$Key%' ORDER BY anime_name ASC";
$Recordset1 = mysql_query($query_Recordset1, $connectDB) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<br>
<table width="375" border="0">
  <tr bgcolor="#FF00FF">
    <td width="81"><span class="style2">Type</span></td>
    <td width="284"><span class="style2">Name</span></td>
  </tr>
  <?php do { ?>
  <tr>
      <td><?php echo $row_Recordset1['type']; ?></td>
      <td><?php echo $row_Recordset1['anime_name']; ?></td>
  </tr>
  <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>

</center>
		</div>
	</div>
	<div id="bottom">
		<div id="word">
			&copy; <?php echo date('Y'); ?>
		</div>
	</div>
</div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>


#2 ignace

ignace
  • Moderators
  • Now mod flavored
  • 6,429 posts
  • LocationBelgium

Posted 01 October 2006 - 01:11 PM

first of all your gonna need an ASCII Table to understand this, www.google.com/search?q=ascii+table

<?php
$Key = $_REQUEST['key'];

if (!$Key) {
  $ASCII= 65; # uppercase (+32 for lowercase)
  $i = 1;
  while ($i < 27) {
    $Char = chr($ASCII);
    echo("<a href='?key=$Char'>$Char</a>");
    $i++;
    $ASCII++;
  }
} else {
  $SQL = sprintf("SELECT `bla` FROM `blaTable` WHERE `bla` LIKE `%s*`", $Key);
  # pass $SQL to the database
}
?>


#3 thechris

thechris
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 04 October 2006 - 10:13 PM

anyone else?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users