Hi
I am trying to do something with PHP and having problems - a bit of a
a PHP novice I'm afraid.
What I am trying to achieve is to display the alphabet and numbers 0-9
on a web page. I want the letters/numbers to be clickable to specific
web pages if there are companies on my database that start with that
letter. If they are not on the database I just wantthe letters
displayed but not clickable.
I'm ok on all of the seperate components but I cannot seem to fit it
all together
1. I do a select from a SQL database using this string to reduce the
company name to it's initial letter.
$query = 'SELECT DISTINCT LEFT(company_name,1) FROM members ORDER BY
company_name ASC';
2. I know I can use the following to get the numbers & letters
displayed.
for ($numbers = 0; $numbers <= 9; $numbers++) {
echo "<a href='members.php?coletter=$numbers'>$numbers </a>";
}
What I can't seem to work out is how to do a loop to do this check and
decide what to echo
After a few hours of trying various things from the manuals and web I
am now looking for some assistance.
Any help would be appreciated.