mysql results as links

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Evidence
Forum Newbie
Posts: 1
Joined: Fri May 14, 2004 10:37 pm

mysql results as links

Post by Evidence »

i am displaying results from a mysql database with php. i have a two part question:

1. can i display results as a link? example: display "www.mydomain.com" and link it "www.mydomain.com"

2. can i display results as a link with a display name that is different? example: display "My Domain" and link it to "www.mydomain.com"


Please show me example code :)

I figure #1 would be easier since it is already the link.. but don't know how to do it. how to do #2 would also be nice too, if possible.
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

maybe i'm batting easy here

but connect to the db, select the table, and via a while loop call the mysql_fetch_array function

just insert the variable into the link
Post Reply