Reply
Embedding DB results into HTML?
Old 05-14-2004, 03:19 AM Embedding DB results into HTML?
Junior Talker

Posts: 3
Trades: 0
Hi. I want to have a webpage that will have the results of a MySQL lookup in it. Basically I want to query a database table, grab the top 5 results (after sorting), and display those on an HTML page.

I have the MySQL code working, but I'm not sure how to integrate this in to an HTML page. I don't want to use SSI as I'd need to rename all my pages to .shtml, which doesn't work for my setup. I also would rather not call a CGI to generate the HTML as this is also not consistant with my site's set up. Is there a way to include these inside the HTML, or perhaps I could have a script which generates a page that gets included into this HTML?

Thanks a lot.

david
http://www.picturesofsoup.com
soupandtea is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 05-14-2004, 03:12 PM
cmonkey's Avatar
Ultra Talker

Posts: 268
Trades: 0
First of all, I think this thread should have been started in the "PHP and MySQL" Forum, but anyways...

Any page that you wish to integrate PHP in should be a .php file, so if you're trying to execute a PHP script in a .htm file, its not going to work, your server won't know to parse the the PHP and it will just spit out the code when you view the page.

As for displaying the results of your MySQL query, just loop through the query result and display the data however you would like. You said the query part of your script is already working so where are you executing that from?

If you need a code sample let me know.
cmonkey is offline
Reply With Quote
View Public Profile
 
Old 05-17-2004, 03:04 PM
Junior Talker

Posts: 3
Trades: 0
Ah, thanks. It seems like I'll have to reconfigure my server setup since PHP really is the way to go. Thanks for the help.
soupandtea is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Embedding DB results into HTML?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.11168 seconds with 13 queries