/    Sign up×
Community /Pin to ProfileBookmark

List language speakers

Hi there.

I’m trying to create a page which will have a dropdown menu of many, many languages and when submitted, will list all people who speak that language.

This may be stored in the database as “native” (native language) or “other” (other language).

At the moment, we have this code repeated for about 50 different languages (obviously not the best way) and hoped you can help us achieve the above where we just have the select menu, and only to show results when that’s submitted.

Addtionally, we want to do the same for country (which is only stored as ‘country’ in the database). Would it be ok to have the two select menus on one page to be submitted?

Current code:

[code=php]
<table class=”forms” cellpadding=”5″ cellspacing=”0″>
<tr class=”bluetop”>
<td colspan=”3″ class=”titletext center”><label class=”pagetitle1″><strong>Language Finder</strong></label></td>
</tr>

<tr class=”nav”>
<td><strong>Language</strong></td>
<td><strong>Speakers</strong></td>
</tr>

<tr onmouseover=”this.bgColor=’#bbddff'” onmouseout=”this.bgColor=’#f0f0f0′”>
<td class=”details”><strong>Afrikaans</strong></td>
<td class=”details”><?php
$list = array();
$users=mysql_query(“Select * from user where native=Afrikaans or other=Afrikaans order by account”);
while ($user=mysql_fetch_array($users))
{
$list[] = ‘<a href=”/roster/index.php?name=’.$user[‘account’].'” title=”‘.$user[‘account’].”s Profile”>’.$user[‘account’].'</a>’;
}
echo implode(‘, ‘, $list); ?></td>
</tr>
</table>
[/code]

Many thanks!

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@bokehFeb 04.2007 — Hi there.

I'm trying to create a page which will have a dropdown menu of many, many languages and when submitted, will list all people who speak that language.[/QUOTE]
How will you know they are telling the truth?
Copy linkTweet thisAlerts:
@DanUKauthorFeb 04.2007 — Hi bokeh ? thanks for your reply.

The languages are only for staff members, not anyone who wishes to register - so they're all accurate.
Copy linkTweet thisAlerts:
@DanUKauthorFeb 06.2007 — any ideas? ?
Copy linkTweet thisAlerts:
@DanUKauthorFeb 10.2007 — Hey, still having problems with this - any help would be appreciated ?
×

Success!

Help @DanUK spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.8,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...