Gossamer Forum
Home : Products : DBMan : Customization :

Retrieving a single field from a single record?

Quote Reply
Retrieving a single field from a single record?
Is there a call I can make to return the value of a single field of a single record? I recognize that it would have to be very specificly phrased.

As an aside, might a small, task specific external Perl script be better suited, and if so, where might I find one?

With this answer in hand, I think I'll have all the tools I need to accomplish my immediate tasks.

As always, thanks in advance!


Victor
Quote Reply
Re: Retrieving a single field from a single record? In reply to
Huh? Can you be more specific or provide a visual example?

Regards.

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Retrieving a single field from a single record? In reply to
An example ... okay, sure.

I am setting up a tournament results page. Since it is an elimination tournament, the results are arranged in a pyramidal grid ... a short example might be as follows, with "rounds" reading down, and letters representing players (although I will try to set it up to read sideways, for formatting purposes here, I'll leave it vertical.)

round 1 A B C D
round 2 A C
round 3 C

(Forgive the fact that when this posts in a proportional font, it'll be a bit out of alignment, but I think you'll get the idea.)

In any case, in the example above, four players start. In round one, players A and C win and advance. In round two, player C wins and advances, etc..

Since the visual format will not translate well in "table" format, which is the way that DBMan outputs information, I'll need to position the player names by hand.

Now the "single record" retrieval part ...

I can set up the page so that the "names" are, in fact, just links to the "player name" in a database ... the records would also hold scoring, etc..

The display on the page would be dynamic. That is to say, by updating the database, the proper names go to the proper places. The displayed names would, themselves be hyperlinks back to the database itself so that by clicking on one would pop up a window with the complete contents of the record, scoring, other info, etc.. That part I think I can pretty much figure out, i.e., the link to "view" a single, complete record output to table format.

What I need is a way of pulling the information contained in a single field (player name) from a single record (record ID would be coded to represent a given position in the grid) in order to display it.

The process would alleviate the necessity of manually modifying each grid page by hand each time a tournament match is played. Rather, I would simply modify the record for that grid position.

I'm making a couple of assumptions here that may, in the end, turn out to bite me in the backside. First, that I can (by creating a link to DBMan or some other program call) display a single field of data from a specific record in the DBMan database. The next one (and possibly the more problematic one) is whether I can make that displayed name a hyperlink itself which, when clicked, will pop up the DBMan record in its entirety. The link to display a single record is not the problem there, I know how I can do that - it's a long, ugly string of calls, but it can be based on a template, pasted and edited pretty simply. The trick will be to make that "link" a "link" itself. I haven't tried to see if I can do that, but I've got other ideas to work around it if I can't.

The dynamic grid page, however, would be a big help.

Does this make the matter any clearer? Or have I just confused you further? <ggg>

If I had to describe it another way, envision a database with three fields per record ... Record#, Name, Score ... all I want to do is show the name field only for a predetermined Record#. However, I want to avoid using any form of HTML Table for output, since I can more easily control the position of a "link", in addition, it makes for a smaller and simpler HTML file.


Ah well, let me know if this makes any sense or if I'm just babbling incoherently. :-)


Victor
Quote Reply
Re: Retrieving a single field from a single record? In reply to
Please excuse me if I do not answer your question correctly...I have a terrible head cold and I just took some cold medicine...

Frown

Anyway, If I understand you correctly..all you want to do is have a list of players and then link to their complete record, right? You have successfully installed the short and long display Mod, right?

If not, you should download it and install it. It is located at:

www.jpdeni.com/dbman/mods.html

Then what you can do is in the sub html_record, make a list of players, by simply putting the Name field and Rounds with the link to the expanded detailed record, like the following:

Code:
print qq|
<div align="center"><center>
<table border="0" width="80%" cellpadding="2">
<tr>
<td valign="top">
Round $rec{'Round'}
</td>
<td valign="top">
<a href="$db_script_link_url&ww=on&$db_key=$rec{$db_key}&view_records=1">$rec{'Name'}</a>
</td></tr></table>
</div></center>

Then in the sub html_record_long, you can add the Scores and other fields associated with each record.

I hope this makes sense.

Regards.


------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Retrieving a single field from a single record? In reply to
Eliot,

Sorry to hear about your cold ... hope you're feeling better soon!

Short/Long ... yes, installed and in use for a database of general information on the players. And anticipated to be used for displaying result details. However, I don't think I can use it for what I'm asking here since the output needs to be formatted in specifc (and oddly positioned) ways, and I can't envision how this can be done within the constraints of a table structure.

I apologize if I haven't made my request clear, you certainly can't be expected to read my mind and your answers to my questions are only as good as the questions themselves.

Let me try a totally different tack ...

The final result I'm looking for is simply a way to display the value of a specific field from a given record in the DBMan database on an outside web page - i.e., a page that is NOT part of the html.pl file created for the database.

The displayed field would ideally be a hyperlink back to DBMan so that clicking it would bring up the full record.

The more I spell it out, the more I realize that what I'm asking for isn't really something that is "within" DBMan, but rather is something that operates from outside DBMan. In other words, just some way to read the DBMan database, pick out a field, and display it.

If indeed this is the case, then perhaps the best I can hope for is that you can give me some insight as to where I might find a sample of a snippet of perl code that would accomplish this.

As always, my thanks ... and BTW, where should I send the steaming bowl of chicken soup! Smile

Victor
Quote Reply
Re: Retrieving a single field from a single record? In reply to
hmmm...

So you want a standard HTML page.. (not generated by DBman) to read the database for information, and to display that information on another standard HTML page.. (also not generated by DBman)??

I beleieve this would require the use of SSI calls.. Unfortunately, I don't know how to do these.. but i'm sure Elliot does Smile



------------------
-----------
millsie :)

A smile a day...
keeps the viri' away.