Gossamer Forum
Home : Products : DBMan : Customization :

add a link in the display database?

Quote Reply
add a link in the display database?
Is it possible to have one of the fields in the displayed database (i.e. the output to 'list all') be a link to another form, i.e. having a database which lists the number of items 'in-stock' and the number in the database functioning as a link to a purchase form if the displayed number is greater than zero.

Any and all help is appreciated!
Quote Reply
Re: add a link in the display database? In reply to
There are a couple of ways to accomplish this...

1) Use the Relational Mod that align db_key fields like the ID field, so that information passed between one database to another database will be in sync.

This Mod is located at the following web address:

www.jpdeni.com/dbman/Mods/relational.txt

2) Then you will have to use conditional statements in the html_record sub-routine in the html.pl file that will link to the type of information you want, like the following:

Code:
if ($rec2{'instock'} > 0) {
print qq|<$font><a href="$db_script_url?db=stock&uid=$db_uid&purchase_form=1">In Stock</a></font>|;
}
else {
print qq|<$font><b>Out of Stock</font></b>|;
}

Of course to make this example work, you will have to do the following:

1) Add codes before this conditional statement that will open the second database and search for values in the instock field. And as of right now...there has not been a fluid solution for searching between two databases in the search form itself (other than searching the databases separately with radio buttons). But to pull the correct data into the result form, you would have to add codes to open and read data from the second database before printing the result.

2) Create a another sub-routine that is for the purchase_form (unless this is an external form, then you can simply link to it).

So, to make a long explanation short...it could be done with a lot of tweaking of the codes. My suggestion is to look at the Relational Mod and see if that will work for you.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums