nope still doesnt work,
i also tried doing this, SUBSTRING('artist','0','1')
heres my code;
<?php
// Get the search variable from URL
$var = @$_GET['letter'] ;
$trimmed = trim($var); //trim whitespace from the stored variable
if(!isset($start)) $start = 0;
if ($letter == "123") {
$query = "SELECT * FROM albums WHERE SUBSTRING('artist','0','1') IN ('1','2','3','4','5','6','7','8','9','0') order by artist";
}
else
{
$query = "select * from albums where artist like \"$letter%\" order by artist";
}
//do database connection
@mysql_connect('localhost', '****', '****) or die("ERROR--CAN'T CONNECT TO SERVER");
@mysql_select_db("nabberuk") or die("ERROR--CAN'T CONNECT TO DB");
$result = mysql_query($query); //you should do error checking
$result = mysql_query($query) or die ("Query failed");
//let's get the number of rows in our result so we can use it in a for loop
$numofrows = mysql_num_rows($result);
$numresults=mysql_query($query);
$numrows=mysql_num_rows($numresults);
$trimmed1 = strtoupper($trimmed);
if ($numrows == 0)
{
if ($letter == "123"){
echo "<p>Sorry, there isn't any artists beginning with a number.<p>";
}
else {
echo "<p>Sorry, there isn't any artists beginning with: "" . $trimmed1 . ""<p>";
}
}
echo "<table width=90% border=0 cellspacing=0 cellpadding=0>
<tr>";
for($i = 0; $i < $numofrows; $i++) {
$row = mysql_fetch_array($result); //get a row from our result set
if($i % 2) { //this means if there is a remainder
echo "<TR bgcolor=\"lightgrey\">\n";
} else { //if there isn't a remainder we will do the else
echo "<TR bgcolor=\"white\">\n";
}
echo "<td width=30%>".$row[artist]."</td>\n";
echo "<td width=30%>".$row[title]."</td>\n";
echo "<td width=5%><a href=".$row[link]."><img src=images/sig2dat.gif width=15 height=15 border=0></a></td>\n";
if ($row[buy] == "") {
echo "<td width=5%> </td>\n";
} else {
echo "<td width=5%><a href=" .$row[buy]."target=_blank><img src=images/buy.gif width=15 height=15 border=0></a></td>\n";
}
echo "</TR>\n";
}
echo "</TABLE>\n";
?>