/    Sign up×
Community /Pin to ProfileBookmark

Listing content

Hi all,

I have a database in Mysql called “database1” and in that database i got a tabel callede “tabel” and in there i got a field called “users”. I want to Generate e menu (simpel tekst links).

For every user in my database there must be a tekst link linking to the page that is the same as the name of the user.

FE: User1 links to user1.html or something like that.

Any one who knows a script for this or can help me.

Thank you in advance,
troy

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@AdamGundryNov 07.2003 — Something like this (untested)?
[code=php]
<?php
@mysql_connect('server', 'username', 'password') or die('Unable to connect to MySQL server.<p>Error: ' . mysql_error());
mysql_select_db('database1');
$resultID = mysql_query('select users from table');
while ($row = mysql_fetch_row($resultID)){
$user = $row[0];
echo "<a href="$user.html">$user</a>";
}
?>
[/code]

Adam
Copy linkTweet thisAlerts:
@troy1984authorNov 07.2003 — Works Great!??

Tnx a lot

Greetings,

Troy
×

Success!

Help @troy1984 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.21,
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,
)...