Gossamer Forum
Home : Products : DBMan : Installation :

DBMan no longer runs after using JPDeni's Admin-only instructions from the tutorial and putting severl fields in one <TD>

Quote Reply
DBMan no longer runs after using JPDeni's Admin-only instructions from the tutorial and putting severl fields in one <TD>
I had DBMan up and running just fine, and really appreciated the instructions on JPDeni's page at http://www.jpdeni.com/dbman/tutorial6.html on how to set up some fields as Admin-only. I then altered my fields a bit and added several more Admin-only fields. Now, DBMan does not work. I have used diff to put the differences betweent the working and non-working files into a txt file I could print and compare, but after making a few minor corrections, I am still getting the error message "Error: DBMan encountered an internal error. Please enable debugging to view." BTW, I do have debugging enabled.

The one big change I made was to put several fields into one <TD>. Is that not possible with DBMan?

I have posted my files to my web server as per JPDeni's suggestion. My .db file is empty right now. The address for the cfg and pl files in text form so some wonderfully helpful person can access them are http://www.ebr.lib.la.us/default_cfg.txt and http://www.ebr.lib.la.us/html_pl.txt .

I have a Unix server...running Apache on a Sun Solaris.

I hope someone can look at what I've done and try to figure out where I'm going wrong. I'm pulling my hair out ;)

Thanks for any help you may be able to give.

Elizabeth
Quote Reply
Re: [ebm76] DBMan no longer runs after using JPDeni's Admin-only instructions from the tutorial and putting severl fields in one <TD> In reply to
In your .cfg file remove the extra lines between your selects like this:

%db_select_fields = (
Day => 'Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,All of,N/A',
Month => 'January,February,March,April,May,June,July,August,September,October,November,December',
Datenum => '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,All',
Year => '2002,2003'

and add a comma at the end of the Datenum line.

Checkbox fields are yes/no fields, and not to be used for a list of selections. If you want to have choices you would either need to change what you have to radio fields, or to define each checkbox as a field. If you use JPDen's configurator it will help you to setup those fields if you don't want to do it manually. There is also information on using checkboxes in the FAQ noted below with examples.

Also please note that the -1 and -2 only work if you have autogenerate turned on. You can control the display and viewing of those fields within your page layouts.

You are missing a field in your html_record_form for the Userid. If you want this admin only but to have the script automatically add the userid, check the FAQ under the section "Admin" for a thread called "How can I get the userid to be displayed in the add form?"

There was a few problems in your html_record_form, the hidden fields were missing the Value=. I've made the changes and condensed the code below. Please note I added hidden fields within table tags, as they are being inserted within the table :)

You might also want to make your Userid field required.


<TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">
<TR><TD colspan=2><input type="hidden" NAME="ID" VALUE="$rec{'ID'}"></TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP" width="20%">&nbsp;<$font>Name of Program:</FONT></TD>
<TD VALIGN="TOP">&nbsp;<INPUT TYPE="TEXT" NAME="Name" VALUE="$rec{'Name'}" SIZE="40" MAXLENGTH="255" width="80%"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Type of Program:</FONT></TD>
<TD VALIGN="TOP">&nbsp;|; print &build_checkbox_field ("Type", "$rec{'Type'}"); print qq|</TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Age Group:</FONT></TD>
<TD VALIGN="TOP">&nbsp;|; print &build_checkbox_field ("Age_Group", "$rec{'Age_Group'}"); print qq|</TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Description:</FONT></TD>
<TD VALIGN="TOP">&nbsp;<TEXTAREA NAME="Description" ROWS="5" COLS="40" WRAP="HARD" MAXLENGTH="1500">$rec{'Description'}</TEXTAREA></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Branch:</FONT></TD>
<TD VALIGN="TOP"><$font>&nbsp;|; print &build_checkbox_field ("Branch", "$rec{'Branch'}"); print qq|</font></TD></TR>|;

if ($per_admin) { print qq|
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Day:</FONT></TD><TD VALIGN="TOP">&nbsp;|; print &build_select_field ("Day", "$rec{'Day'}"); print qq|</TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Date: </FONT></TD>
<TD VALIGN="TOP">&nbsp; |; print &build_select_field ("Month", "$rec{'Month'}"); print qq| &nbsp; |; print &build_select_field ("Datenum", "$rec{'Datenum'}"); print qq| &nbsp; |; print &build_select_field ("Year", "$rec{'Year'}"); print qq|</TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Time: </FONT></TD>
<TD VALIGN="TOP">&nbsp;<INPUT TYPE="TEXT" NAME="Time" VALUE="$rec{'Time'}" SIZE="25" MAXLENGTH="255"></TD></TR>
<TR><TD><$font><B>User ID:</B></font> $reqpic</TD><TD><INPUT TYPE="TEXT" NAME="UserID" SIZE="10" VALUE="$rec{'UserID'}" MAXLENGTH="8"></TD></TR> |;
}
else {
print qq|<TR><TD colspan=2>
<input type="hidden" name="Day" VALUE="$rec{'Day'}">
<input type ="hidden" name="Month" VALUE="$rec{'Month'}">
<input type="hidden" name="Datenum" VALUE="$rec{'Datenum'}">
<input type="hidden" name="Year" VALUE="$rec{'Year'}">
<input type="hidden" name="Time" VALUE="$rec{'Time'}">
<input type="hidden" NAME="Userid" VALUE="$rec{'Userid'}">
</TD></TR> |;
}
print qq|</TABLE> |;

Hope this gets you up and running.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] DBMan no longer runs after using JPDeni's Admin-only instructions from the tutorial and putting severl fields in one <TD> In reply to
Lois,

I made the changes you suggested in my default.cfg and in my html.pl file and dbman initially worked. However, after reading your note about defining each checkbox as a field, I looked at http://gossamer-threads.com/...search_engine#174543, another thread you assisted with, I made the changes suggested there because I wanted to use the checkboxes for multiple selections.

Now, nothing works Unimpressed

I'm getting the following message: "DBMan encountered an internal error. Please enable debugging to view."

I've tried auto-generating the html as well as using the changes I made to my html.pl file. I initially got an error msg in my error_log which read

"Bare word found where operator expected at default.cfg line 135, near "'Special Program
' Announcement"
(Missing operator before Announcement?)"

but that must not have been the only problem. I fixed that and it still doesn't work.

I'm posting my updated default.cfg and html.pl files to http://www.ebr.lib.la.us/default_cfg.txt and http://www.ebr.lib.la.us/html_pl.txt

I'm sorry if I seem dense, but just when I think I have this thing figured out it gets the better of me. ;)

Thanks for any help you Lois, or anyone, might be able to give.

Elizabeth
Quote Reply
Re: [ebm76] DBMan no longer runs after using JPDeni's Admin-only instructions from the tutorial and putting severl fields in one <TD> In reply to
First of all you should have your checkbox definitions listed each on a line such as:

%db_checkbox_fields = (
Main => 'Main',
'Bluebonnet Regional' => 'Bluebonnet Regional',
'Greenwell Springs Road Regional' => 'Greenwell Springs Road Regional',
'Jones Creek Regional' => 'Jones Creek Regional',
Baker => 'Baker',
Carver => 'Carver',
Central => 'Central',
Centroplex => 'Centroplex',

etc. ...........

You may also want to move:

$db_debug = 1;

to up above # File and URL's so it will catch all errors within your .cfg

I glanced at your html.pl file and didn't spot anything wrong there. I would suggest visiting the FAQ and under the section "Troubleshooting" you will find a snippet of code you can add to your .cfg, html.pl, and db.cgi files which will provide you with useful error messages.

The thread is called "Debugging - How To Obtain Useful Error Messages"

Hope this helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/