Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Simplest way to link to a small database

Simplest way to link to a small database
Thread Tools
Mac Elite
Join Date: Jun 2001
Location: NYNY
Status: Offline
Reply With Quote
Apr 1, 2002, 01:37 PM
 
I'm working on a site that has about 100 member listings and will grow to about 1000. I want to just keep adding the names to the database as I get them and have them update in the HTML page...without having to add them manually to the HTML page each time I add a few names.

I can't use the Library feature of Dreamweaver because the listings include email addresses and URL's, or can I?

I don't know much about database driven sites so I'm wondering if there is a simple way to do this with Dreamweaver..or do I need UltraDev?

Also, I'm on a Mac.

Thanks for the advice
"Well done is better than well said." -BF
Commercial Range
     
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Apr 1, 2002, 03:13 PM
 
Use PHP to query the database and echo out the results in while loop with formatting tags within the while loop. Example:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
$query = <font color = red>"SELECT username FROM users"</font>;
$result = mysql_query($query);
while($query_data = mysql_fetch_row($result)) {
$regusers = mysql_result($result,$i,<font color = red>"username"</font>);
echo <font color = red>"$regusers"</font>;
}
</font>[/code]

This will query a table named users and get all the usernames. It will then go through the results and print each username. I know that there's a more efficient way to do it, but that's how I do it. As for doing this in DW, I have no idea.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:05 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2