Gossamer Forum
Home : Products : DBMan : Customization :

0 (Can not be left blank) ?

Quote Reply
0 (Can not be left blank) ?
Hi,

Problem I meet.

I have about 27 fields on db.

Always the letter of "default" is printed at 21th field

Also, the error massage of "0 (Can not be left blank)" is showed up every time I add new.

I never made a field of "0".
So I can't control it with 0,1 at 'not_null' section.

Please help.
Quote Reply
Re: 0 (Can not be left blank) ? In reply to
Hello koreags:

"default" is printed on the 21st field because the default value for that field is "default". If you change the default value for that field to "" then nothing will be shown.

I am not too sure what the second problem is caused by. Without any more details, my best guess is that what 0 means is the ID field. That is the first field. Now if you check that and make sure that it is always filled in with a unique key then I think you will have solved your problem. Another variant of this scenario is that you have made your 0th field an administrative field where the field type is -1. This will not be shown on the html but is there nonetheless.

If you still cannot solve the problem, tell me in more details what is going on and I will try to help you.

Cheers
Sun

------------------
-------------------- Gossamer Threads Inc. ----------------------
Sun Djaja Email: sun@gossamer-threads.com
Internet Consultant
http://www.gossamer-threads.com

Quote Reply
Re: 0 (Can not be left blank) ? In reply to
Both of these are caused by problems in your .cfg file.

Someone a while back had the "0 (Can not be left blank)" message turning up, too. I don't recall what the problem was, but maybe if I look at your .cfg file I'll be able to figure it out.

The "default" text being automatically added to a field relates to the setting of your $auth_user_field.


------------------
JPD





Quote Reply
Re: 0 (Can not be left blank) ? In reply to
Thanks sun and JPDeni
Here is I modified section. Please check any error;
Code:

%db_def = (
ID => [1, 'numer', 5, 8, 1, '', ''],
Date => [2, 'date', 12, 15, 1, &get_date, ''],

Company-name => [3, 'alpha', 40, 255, 1, '', ''],
Address => [4, 'alpha', 40, 255, 1, '', ''],
Factory-address => [5, 'alpha', 40, 255, 0, '', ''],
Company-number => [6, 'alpha', 40, 255, 0, '', ''],
President-name => [7, 'alpha', 40, 255, 1, '', ''],
Products => [8, 'alpha', 40, 255, 0, '', ''],
Company-tel => [9, 'alpha', 40, 255, 0, '', ''],
Company-fax => [10, 'alpha', 40, 255, 0, '', ''],

Name => [11, 'alpha', 40, 255, 1, '', ''],
ID-number => [12, 'alpha', 40, 255, 1, '', ''],
Tel => [13, 'alpha', 40, 255, 1, '', ''],

Homepage1 => [14, 'alpha', 40, 255, 1, 'http://', '^http://'],
Homepage2 => [15, 'alpha', 40, 255, 0, 'http://', '^http://'],
E-mail1 => [16, 'alpha', 40, 255, 1, '', ''],
E-mail2 => [17, 'alpha', 40, 255, 0, '', ''],
Bank-name => [18, 'alpha', 40, 255, 1, '', ''],
Bene-name => [19, 'alpha', 40, 255, 1, '', ''],
Account => [20, 'alpha', 40, 255, 1, '', ''],


Card => [21, 'alpha', 0, 3, 1, 'Yes', 'Yes|No'],


Rentversion => [22, 'alpha', 0, 255, 1, '', ''],


Directory-name => [23, 'alpha', 40, 255, 0, '', ''],

Admin-id => [24, 'alpha', 40, 255, 1, '', ''],
Admin-password => [25, 'alpha', 40, 255, 1, '', ''],

Image => [26, 'alpha', 0, 3, 1, 'Yes', 'Yes|No'],

Others => [27, 'alpha', '60x4', 500, 0, '', ''],

Userid => [28, 'alpha', -2, 15, 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 = 1;
# 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 = 0;
# Display Benchmarking Information (1 = Yes, 0 = No).
# use Benchmark; # Uncomment this line if benchmarking is used.
$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 = (
Rentversion => 'Factory Cart Lite,Factory Cart,Factory Cart Gold'

);

# Radio fields. Field name => comma seperated list of radio buttons.
%db_radio_fields = (
Card => 'Yes,No',
Image => 'Yes,No'

);

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

# Default maximum number of hits returned in a search.
$db_max_hits = 10;
# 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 = 22600; # 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 = 1;

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

# Registered users: can view _only_ own records. For this to make sense
# you should turn off default permissions.
$auth_view_own = 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 = 9;

# 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://www.gossamer-threads.com/scripts/dbman/";


[This message has been edited by koreags (edited June 29, 1999).]
Quote Reply
Re: 0 (Can not be left blank) ? In reply to
The first thing I see is that you have started your numbering incorrectly. The first field must be field 0.

Change

ID => [1, 'numer', 5, 8, 1, '', ''],

to

ID => [0, 'numer', 5, 8, 1, '', ''],

and adjust all your other field numbers so they are sequential.

That's all I see at the beginning. You didn't post the end of the configuration, though, so I can't tell you how to fix the problem with "default" appearing in your field. My guess is that you would want to set $auth_user_field = 27 (which will be the correct number of your Userid field when you make the adjustment above).

Also, I'm not sure about how your authentication is set up. If you're getting "default" all the time, it could be that you have set $auth_no_authentication = 1. If you want users to log in (or anyone to log in, for that matter), you must set $auth_no_authentication = 0.


------------------
JPD





Quote Reply
Re: 0 (Can not be left blank) ? In reply to
Thanks JPDeni

First time I tried
ID => [0, 'numer', 5, 8, 1, '', ''],
However, I met error.
So, I changed it to
ID => [1, 'numer', 5, 8, 1, '', ''],

login "default" all the time at user side.
and "admin" only can log in.

I post the end of the configuration at above
Thanks in advence



[This message has been edited by koreags (edited June 29, 1999).]
Quote Reply
Re: 0 (Can not be left blank) ? In reply to
I tried to change
ID => [1, 'numer', 5, 8, 1, '', ''],
to
ID => [0, 'numer', 5, 8, 1, '', ''],
and all of the rest.


$auth_no_authentication = 1 or 0
deosn't fix the error.

Now, the 21th field is Card.
It meet following error.
Card (Invalid format)
Card (Too long. Max length: 3)
0 (Can not be left blank)

Because there is printed always default or admin on card field according to login ID, the Card field meets that error.


[This message has been edited by koreags (edited June 29, 1999).]
Quote Reply
Re: 0 (Can not be left blank) ? In reply to
Rather than posting your .cfg file to the forum, it would be easier if I could actually see it. (I should have explained this before. Sorry.)

Copy your .cfg file and put it in a web-accessible directory -- a directory where you would place html files. Rename the file to default_cfg.txt. Then come back here and tell us where to look at it.


------------------
JPD





Quote Reply
Re: 0 (Can not be left blank) ? In reply to
Thanks JPDeni


factory.co.kr/tmp/default_cfg.txt

[This message has been edited by koreags (edited June 29, 1999).]
Quote Reply
Re: 0 (Can not be left blank) ? In reply to
I'm back JPDeni
Quote Reply
Re: 0 (Can not be left blank) ? In reply to
Take off the last comma after your Userid field defnition. It should be

Userid => [27, 'alpha', -2, 15, 0, '', '']

not

Userid => [27, 'alpha', -2, 15, 0, '', ''],


The reason you're getting "default" in a field (although I don't know why it's in the field it's in) is that you are allowing a default user to add records. If you want users to be able to "own" records, you must require them to login first.

You haven't changed

$auth_user_field = 9;

from the demo. Did you want your userid field to be "Userid"? If so, you need to change the $auth_user_field to 27.

You really ought to have made sure that your fields were working correctly before you added any modifications to the script. It's easier to find problems if you make sure one thing works before you go on to the next.

Since you changed the numbering of your fields, have you continued to have the "0 (Can not be left blank)" problem?


------------------
JPD





Quote Reply
Re: 0 (Can not be left blank) ? In reply to
JPD

Solved the "default" printed error after done by your advice.
Thank you

But still I got the "0 (Can not be left blank)" error.

I should re-modify this script again for all.
Quote Reply
Re: 0 (Can not be left blank) ? In reply to
It could be something in your html.pl file, too.

I'll see if I can find where the previous post was about this same problem.


------------------
JPD





Quote Reply
Re: 0 (Can not be left blank) ? In reply to
Thank you JPD

I will also check html.pl too.
Quote Reply
Re: 0 (Can not be left blank) ? In reply to
Thank you JPD

I will also check html.pl too.
Quote Reply
Re: 0 (Can not be left blank) ? In reply to
Seems I found the problem.

At field name i use "-" between two words for joining the two words.
as follows;
Factory-address
Company-number
President-name

After I delete "-" between two words.
as follows;
Factoryaddress
Companynumber
Presidentname

It works good.

Thank you for all of your kindness JPDeni

Quote Reply
Re: 0 (Can not be left blank) ? In reply to
Ah! Thank you for letting me know. I will try to remember that if anyone else comes up with the same problem.

Glad you were able to figure it out. Smile

You're welcome!


------------------
JPD