Poetry help again
Posted: Thu Aug 25, 2005 9:26 am
for some reason my script will throw out all the users name at the beginning which i want it just show the alphabet :S but here is where i think the problem is at
but here is the script for it
Thank you
Smackie
Code: Select all
$sql = mysql_query("SELECT * FROM users WHERE user_name like '$letter%'");
while ($row = mysql_fetch_array($sql)) {Code: Select all
<?php
echo '<center>';
// This function makes the alphabetic list which the links.
function drawAddressList() {
$seperator = "-";
// Loop through all 26 characters.
for ($i = 1; $i <= 26; $i++) {
$letter = chr($i + 64);
echo $seperator . "<a href='{$_SERVER['PHP_SELF']}?pages=letter&letter={$letter}'><font class=\"txt\">{$letter}</font></a>";
}
echo $seperator . '<br />';
}
// This function gets a parameter or the default.
function getParm($VariableName, $Default = '') {
return (isset($_GET[$VariableName])) ? $_GET[$VariableName] : $Default;
}
drawAddressList();
echo '<br>';
$letter = $_REQUEST['letter'];
$sql = mysql_query("SELECT * FROM users WHERE user_name like '$letter%'");
while ($row = mysql_fetch_array($sql)) {
echo '<a href="index.php?pages=data&user_name='.$row['user_name'].'"><font class=\"txt"\ color=\"red"\>'.$row['user_name'].'</font></a><br>';
}
echo '</center>';
?>Thank you
Smackie