thechris Posted October 1, 2006 Share Posted October 1, 2006 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.[code]<!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'); ?><?phpmysql_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"> © <?php echo date('Y'); ?> </div> </div></div></body></html><?phpmysql_free_result($Recordset1);?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/22652-need-help-displaying-certain-selection/ Share on other sites More sharing options...
ignace Posted October 1, 2006 Share Posted October 1, 2006 first of all your gonna need an ASCII Table to understand this, www.google.com/search?q=ascii+table[code]<?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}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/22652-need-help-displaying-certain-selection/#findComment-101799 Share on other sites More sharing options...
thechris Posted October 4, 2006 Author Share Posted October 4, 2006 anyone else? Quote Link to comment https://forums.phpfreaks.com/topic/22652-need-help-displaying-certain-selection/#findComment-103976 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.