Gossamer Forum
Home : Products : DBMan : Installation :

My DB won't let me change anything...

Quote Reply
My DB won't let me change anything...
Hello! I'm new to the world of Perl and other scripting, I've been doing HTML for a while though, and I decided to try DBMan after seeing how well it works for a game I play. It would also be good for when I go to Perpich next year and learn Media Arts, practice and all.

I'm trying to set up a database with 13 fields for another horse game I play to archive old horses. Name, ID, Breed, Color, Age, DOB, Points, Owned, Sire, Sire ID, Dam, Dam ID, Foals, Notes. The ID field would be unique to every horse, but it wouldn't be run in a counter fashion. Everything is text fields except Foals and Notes, which were text boxes so I could say more. Name, Breed, Color, Sire, Dam, Foals, and Notes are alpha fields, everything else but DOB would be numbers, DOB would be dates, but I wouldn't know the dates for every horse. The required fields are: Name, ID, Breed, Age, Points, Sire ID, Dam ID. I would be the only one with access to modify anything, but anyone who visits can login and see it.

But, when I upload it to Netfirms (the only free CGI hoster I can find, spent $70 at register.com for a domain for my mom and they don't even host CGI), it just tells me there is an internal error, and that I need to turn on debugging. The actual DB should be at http://3horseranch.netfirms.com/cgi-bin/dbman/db.cgi. I can get the demo to work on there fine, but as soon as I start changing things it refuses to work. I have turned the debugging on with no change.

I made sure the Perl path is correct, everything was uploaded ASCII, changed the permissions to what the README file wants, and that the demo worked. I'm pretty sure its my scripting messing everything up, but I can't for the life of me figure out what I did...

Any help? I do have copies of the original scripts from the DBMan download, if I really screwed it up :). I am wanting to make more DB's in the future, but I need to figure out how to make this one work first. This is the second time I've tried to get this to work. I'm following the JPDeni's DBMan-ual, "Create Your Own Configuration" is where I lose everything.

P.S. I would like to know if its possible to have the age of every horse in the DB age 1 year at 12 am Saturday night (Eastern USA Time) every week, like the game I play. Any way to automatically do that?

Thanx, The Buckskin Appy

I hope I have enough info for help...Smile

Here's a copy of my default.cfg file, w/o the top part by the writer...

# File and URL's
# --------------------------------------------------------
# URL of the directory dbman resides in. No Trailing Slash Please.
$db_dir_url = "http://3horseranch.netfirms.com/cgi-bin/dbman";
# URL of dbman.
$db_script_url = $db_dir_url . "/db.cgi";
# Full Path and File name of the database file.
$db_file_name = $db_script_path . "/default.db";
# Full path and file name of the counter file.
$db_id_file_name = $db_script_path . "/default.count";
# Full path and file name of the authorization directory.
$auth_dir = $db_script_path . "/auth";
# Full path and file name of the password file.
$auth_pw_file = $db_script_path . "/default.pass";
# Full path and file name of the log file.
$auth_log_file = $db_script_path . "/default.log";
# Full path and file name of the html routines.
require $db_script_path . "/html.pl";

# Database Definition
# --------------------------------------------------------
# Definition of your database. Format is
# field_name => ['position', 'field_type', 'form-length', 'maxlength', 'not_null', 'default', 'valid_expr']

%db_def = ( Name => [0, 'alpha', 40, 255, 1, '', ''],
ID => [1, 'numer', 20, 40, 1, '', ''],
Breed => [2, 'alpha', 40, 255, 1, '', ''],
Color => [3, 'alpha', 40, 255, 0, '', ''],
Age => [4, 'numer', 20, 40, 1, '', ''],
DOB => [5, 'date', 12, 15, 0, '', ''],
Points => [6, 'numer', 20, 40, 1, '', ''],
Owned => [7, 'numer', 20, 40, 0, '', ''],
Sire => [8, 'alpha', 40, 255, 0, '', ''],
Sire ID => [9, 'numer', 20, 40, 1, '', ''],
Dam => [10, 'alpha', 40, 255, 0, '', ''],
Dam ID => [11, 'numer', 20, 40, 1, '', ''],
Foals => [12, 'alpha', '10x10', 2000, 0, '', ''],
Notes => [13, 'alpha', '10x10', 2000, 0, '', '']
);

# The column name for the database key. Can be any column, but it must be unique!
# You can't have two records with the same key value!
$db_key = 'ID';
# Track the key? Should DBMan keep a counter of the next key to use? This isn't
# neccessary if you can guarantee that your entry in the key field will be unique
# (i.e. a userid).
$db_key_track = 0;
# Database delimeter.
$db_delim = '|';
# Use file locking (1 = Yes, 0 = No). Should be used, but won't work on Win95.
$db_use_flock = 1;
# Auto generate the html forms (1 = Yes, 0 = No).
$db_auto_generate = 1;
# Display Benchmarking Information (1 = Yes, 0 = No).
$db_benchmark = 0;
# Display Debugging Information (1 = Yes, 0 = No).
$db_debug = 1;

# Select fields. Field name => 'comma seperated list of drop down options'.
%db_select_fields = ();

# Radio fields. Field name => comma seperated list of radio buttons.
%db_radio_fields = ();

# Checkbox fields. Field name => Checkbox value.
%db_checkbox_fields = ();

# Default maximum number of hits returned in a search.
$db_max_hits = 20;
# Bold search results (1 = Yes, 0 = No).
$db_bold = 1;
# Regular and title fonts used in auto_generatrion and html.pl.
$font = 'font face="verdana,arial,helvetica" size="2"';
$font_title = 'font face="verdana,arial,helvetica" size="4"';

# Authorization Options
# --------------------------------------------------------
# No Authentication? (1 = "there is no authentication", 0 = "there is authentication")
# If you choose no authentication, then set the permissions of what
# people can do with: @auth_default_permissions below.
$auth_no_authentication = 0;

# The amount of time in seconds that user files are kept in the
# auth directory before the program removes them. 2-6 hours is
# probably a good value.
$auth_time = 21600; # 6 hours (in seconds)

# Enable (1) or disable (0) logging.
$auth_logging = 1;

# Allow a default user? This means you can specify a user via the URL
# and skip the logon process. Use this to allow people to search without
# logging on, but require log in if they want to add/modify/remove etc.
# (1 = "yes", 0 = "no")
$auth_allow_default = 0;

# Default permissions used if there is no authentication, or for a default
# user. (View, Add, Delete, Modify, Admin), 1 = enable, 0 = disable.
@auth_default_permissions = (1,1,1,1,0);

# Allow people to sign up for their own userid/passwords? They will
# recieve default permissions.
$auth_signup = 1;

# Permissions a new signup should get.
@auth_signup_permissions = (1,1,1,1,0);

# Registered users: can modify/delete _only_ own records. For this to make
# sense you should set default off or to 1,0,0,0.
$auth_modify_own = 0;

# Registered users: can view _only_ own records. For this to make sense
# you should turn off default permissions.
$auth_view_own = 0;

# Auth user field. This is the field position in the database used for storing
# the userid who owns the record. Set to -1 if not used.
$auth_user_field = -1;

# URL to send user if they chose log off. Leave blank and the script will return to
# the logon prompt (although this only makes sense if you are using authentication).
$auth_logoff = "http://3horseranch.netfirms.com/cgi-bin/dbman/db.cgi";

# ===========================================================================
# Build up some variables from your definitions. Internal use only.
foreach (sort { $db_def{$a}[0] <=> $db_def{$b}[0] } keys %db_def) {
push (@db_cols, $_);
$db_sort{$_} = $db_def{$_}[1];
$db_form_len{$_} = $db_def{$_}[2];
$db_lengths{$_} = $db_def{$_}[3];
$db_not_null{$_} = $db_def{$_}[4];
$db_defaults{$_} = $db_def{$_}[5];
$db_valid_types{$_} = $db_def{$_}[6];
($_ eq $db_key) and $db_key_pos = $db_def{$_}[0];
}
1;
Quote Reply
Re: [thebuckskinappy] My DB won't let me change anything... In reply to
i played around with dbman for about a month a few weeks ago. Many times when I got that type of error msg, it was because of some inconsistency between the database and the db_def section in default.cfg.

For example, after you added the additional fields ( from 10 thru 13 ), did you update the default.db file to include the extra delimiter?


Also, look at your $db_key_track = 0. Read what the instrucions in the default.cfg have to say about this value. You may want it to be 1.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."

Last edited by:

esm: Apr 22, 2003, 3:25 PM
Quote Reply
Re: [esm] My DB won't let me change anything... In reply to
The tutorial said to wipe default.db, .log, and .count and upload them again to make the new files work. I don't know where any inconsistancies would be between a blank file and any other :).

The ID field in my DB isn't being kept track of because I don't want it to. HorseLand.com is the game I play, and each horse you have has a unique ID number assigned to it when it is created. They're over the 2 million mark, and none of mine are in order, so having a counter keep track wouldn't be very helpful.
Quote Reply
Re: [thebuckskinappy] My DB won't let me change anything... In reply to
sounds good on the ID field. It just needs to be unique and I don't see anything about it having to be in order.

When you say wipe out and upload again, what does that mean specifically? If you deleted all the demo entries in default.db and uploaded a blank default.db (0 bytes) and set the persmission to 666, then your problem is probably elsewhere.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] My DB won't let me change anything... In reply to
Yes, I uploaded blank files of all of those, and the permissions were set to 666. The HTML and this file are the only ones I needed to change. I used the html maker on the manual's site for the HTML, except for the header which I set to "The Buckskin Appy's HorseLand Database". If there's nothing wrong with this file (the one I pasted up above, I can't see it while I'm replying...), then maybe it's the server?
Quote Reply
Re: [thebuckskinappy] My DB won't let me change anything... In reply to
Umm, hmm... I just went into my db again, and it's working. Wierd. I guess it was right.
Quote Reply
Re: [thebuckskinappy] My DB won't let me change anything... In reply to
I notice you have the permissions set to have it use registered users to add records. This means you would also need to include a field which would hold the userid and change the setting for:

$auth_user_field = 1;

to match the field number for the userid. Otherwise you can change the permissions to allow a default user. And turn off the option to signup:

$auth_signup = 1;

Unoffical DBMan FAQ

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