Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for a code

Status
Not open for further replies.

SomeHorse

Technical User
May 27, 2003
5
US
I have a database set up that includes a bunch of different information. What I really want to do is have say that records name shown (along with all the other record's names) displayed on one page and then allow the person viewing the database to click on a name and go to a page that contains all the information JUST on that one record. So, first question is, is there even a code like this? If so, where can I find it?

I've already looked on PHP.net and didn't find anything that I thought would work or that I could understand. Any help is apperciated!
 
That shouldn't be too hard

First, check isset($_GET['recordname']).

If it is not set, do a SELECT recordname FROM thetable. Then output an HTML table, with each record name becoming a hyperlink back to the same document. For example, one row may look like this (in the final output)

<tr><td><a href=&quot;recordlookup.php?recordname=Bob&quot;>Bob</a></td></tr>

But if $_GET['recordname'] is set, then you retrieve the data for that one record. SELECT * FROM thetable WHERE recordname=$_GET['recordname'] will do.

Then simply output the data for that record in whatever style you like.

Sorry that I haven't given any code examples, but I'm fairly new to PHP and I don't want to mislead you with invalid code.

Though I must say PHP is really easy to pick up on.

I REALLY hope that helps.
Will
 
Sorry, im confused... Im very new to php and mysql and I dont know very much at all. Can you explain a bit more?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top