Gossamer Forum
Home : Products : DBMan : Installation :

Getting an error on the form that I cannot correct

Quote Reply
Getting an error on the form that I cannot correct
Hi folks!

Hopefully, I have a simple issue that I am just overlooking.

I have a new dbman database that I am setting up. So far everything appears to work as far as the script and such goes.

However, when the form has been filled out and the submit button clicked, I get an error. I have an ID field that I am using as my key field. I wish for this data to increase by 1 each time, thereby keeping count and providing a unique id number. The problem is that no matter what number is put into the field, "default" is what appears in the record and causes the error message to be generated. I cannot find where this info/data is being pulled from.

Any suggestions?

Ziggy
Cool
Visit the GRUMPY OLD MEN website!
G R U M P Y O L D M E N
Acoustic Blues, Light Rock and Original Music
http://www.starkiller.com/grumpyoldmen
Quote Reply
Re: [starkiller] Getting an error on the form that I cannot correct In reply to
Check your .cfg file and be sure you have the your fields are numbered starting with 0.

If you ID field is as an example:

'ID' => [ 0,'numer',5,10,1,'','\d{1}'],

then set:

$db_key = 'ID';
$db_key_track = 1; # Track the key?

You may need to post a text copy of your .cfg file so if that doesn't solve your problem. It could be something simple. Viewing your .cfg file would help to see what you are working with.








Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [starkiller] Getting an error on the form that I cannot correct In reply to
Hi,

You would need something like:

'ID' => [ 0,'numer',5,10,1,'','^\d+$'],

\d{1} could cause you trouble

Last edited by:

PaulW: Dec 7, 2001, 11:16 AM
Quote Reply
Re: Thank you LoisC and PaulW: Getting an error on the form that I cannot correct In reply to
Thank you, both LoisC and PaulW,

However, now instead of getting "Too Long" error, I now get Invalid Format as well. If you wish to check it out, go to:
http://www.starkiller.com/...=fan&uid=default

Here is the cfg file:

Code:
# File and URL's
# --------------------------------------------------------

$db_dir_url = "http://www.starkiller.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 . "/fan.db";
# Full path and file name of the counter file.
$db_id_file_name = $db_script_path . "/fan.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 . "/fan.pass";
# Full path and file name of the log file.
$auth_log_file = $db_script_path . "/fan.log";
# Full path and file name of the html routines.
require $db_script_path . "/fanhtml.pl";

# Database Definition
# --------------------------------------------------------

%db_def = (
'FanID' => [ 0, 'numer',4,4,1, '','^\d+$'],
'Firstname' => [ 1, 'alpha',20,255, 1,'',''],
'Lastname' => [ 2, 'alpha',20,255, 1, '',''],
'Nickname' => [ 3, 'alpha',20,255, 1, '',''],
'City' => [ 4, 'alpha',20,255, 1, '',''],
'State' => [ 5, 'alpha',0,2,1,'',''],
'Age' => [ 6, 'numer',0,5, 0, '', ''],
'Sex' => [ 7, 'alpha',0,7, 0, 'Female',''],
'Email' => [ 8, 'alpha',20,255,0,'','.+@.+..+'],
'Subscribe' => [ 9, 'alpha', 0, 4, 1, 'Yes',''],
'URL' => [10, 'alpha',20,255,0,'http://','^http://']
);

$db_key = 'FanID';
$db_key_track = 1;

# 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 = 0;
Visit the GRUMPY OLD MEN website!
G R U M P Y O L D M E N
Acoustic Blues, Light Rock and Original Music
http://www.starkiller.com/grumpyoldmen

Last edited by:

LoisC: Dec 7, 2001, 6:51 PM
Quote Reply
Re: [starkiller] Thank you LoisC and PaulW: Getting an error on the form that I cannot correct In reply to
What is being entered into the fanid field? Is it just a number?
Quote Reply
Re: [PaulW] Thank you LoisC and PaulW: Getting an error on the form that I cannot correct In reply to
Yes. I just wanted it to be an auto number... keep track of how many as well as assign a unique id.
Visit the GRUMPY OLD MEN website!
G R U M P Y O L D M E N
Acoustic Blues, Light Rock and Original Music
http://www.starkiller.com/grumpyoldmen
Quote Reply
Re: [starkiller] Thank you LoisC and PaulW: Getting an error on the form that I cannot correct In reply to
I believe the problem is with:

# 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 = 0;

You don't appear to have a userid field so you will want to set this to:

$auth_user_field = -1;

You might want to consider adding a userid field to the database if you are having others enter data.

Hope this helps


Unoffical DBMan FAQ

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