NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Parsing database via PHP. Display options, etc.

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
6 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 10-16-2011, 05:52 PM THREAD STARTER               #1 (permalink)
o-re-sa-ma
 
Jed K's Avatar
Join Date: Jun 2003
Posts: 1,620
Jed K has much to be proud ofJed K has much to be proud ofJed K has much to be proud ofJed K has much to be proud ofJed K has much to be proud ofJed K has much to be proud ofJed K has much to be proud ofJed K has much to be proud of
 



Help! Parsing database via PHP. Display options, etc.


I have a MySQL database in phpMyAdmin with one table and over 7,000 entries/rows.

How do I go about parsing this information and displaying them on a website? What PHP code do I need to use?

Also, how do I go about making sure each of these 7,000 entries gets its own URL? I want each entry name and id# to be included. For example...
http://www.mysite.com/db/dogs?id=1
http://www.mysite.com/db/cats?id=2
http://www.mysite.com/db/monkeys?id=3
????: NamePros.com http://www.namepros.com/programming/734414-parsing-database-via-php-display-options.html
etc.

I am still very new to this, so please keep it as simple as possible.

At least I already have the database set up! I just need to figure out the output.

Jed K is offline   Reply With Quote
Old 10-18-2011, 11:44 AM   #2 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
have you got started with anything as of yet?

for the url's you will need to use mod rewrite so that http://www.mysite.com/db/dogs?id=1 would be rewritten too

http://www.mysite.com/db/script-name.php?cat=dogs&id=1

or alternatively have a php file for each category and do the rewrite too:
????: NamePros.com http://www.namepros.com/showthread.php?t=734414

http://www.mysite.com/db/dogs.php?id=1

The displaying details you will need to do something like the following:

Quote:
$db = mysql_connect('server-name', 'username', 'password');
$sql = "Select * from table_name where cat='dog' and id = 1";
$resultset = mysql_query($sql,$db);
while($row = mysql_fetch_assoc($resultset))
{
//output the row this is an array with keys that match the colum headers from mysql
}
As you have got 7000 results however I would strongly suggest splitting the results over pages (like ebay etc do, they dont show every result they split it into batches od 50 or so)
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display database contents within HTML Archeyreece Programming 3 07-18-2011 10:36 AM
Selling Keywords Of Your Category Gangstex For Sale / Advertising Board 1 07-12-2011 04:34 AM
[4HIRE] PHP / MySQL / Javascript - Frameworks and OOP alecksmart Developers For Hire 0 06-24-2011 12:47 AM
wordpress readymade database for Sell yengkok Content For Sale 0 05-22-2011 12:44 AM

 
All times are GMT -7. The time now is 02:49 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger