Gossamer Forum
Home : Products : DBMan : Customization :

ERROR RECORD

Quote Reply
ERROR RECORD
in default.cfg i inserted in field_name "email" between URL and Type(cut&paste)then printed the html_record form &html_record;the add form shows "email" but when i submit
this is what i get<Error unable to add record>
Popular(Too long.Max lenght:3)i do have 3 in "maxlenght"
anyone's idea how to get around it!
Cheers
macagy

Quote Reply
Re: ERROR RECORD In reply to
The "Max Length" is set by the 4th argument, your line probobly looks something like this:
Email => [3, 'alpha', 10, 3, 1, '', '']

Change 3 to something larger (eg: 50)
That should do the trick.

- Mark

Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: ERROR RECORD In reply to
Hello macagy,

If you added a new field between to fields already configured into your db, you are likely getting the error because your databse has not been modified to reflect the new field.

For example, if you have an entry such as:
Email => [3, 'alpha', 10, 255, 1, '', '']
this is indicating the Email field is the third position in your database:

field1|field2|Email|field4....etc

If you did not modify the database file to include the additional new field, your db contents are out of position and will result in the wrong input attempting to populate a db field - hence, the too long error.

Fix Your options would be
1) If this is a fairly new db with not manyrecords, simply modify the database by placing a pipe | in the proper position within the database (between the URL and Type fields).

2) If you have a good number of records and do not want to add the pipe in each record, simply move the new field Email to the bottom of the field list and renumber the fields correctly again.

Hope this helps.

Quote Reply
Re: ERROR RECORD In reply to
How about starting the day with THIS ONE from Bizzaro...
Here 2 young women chatting " HE PROMISED IF I MARRIED HIM, HE'D GIVE ME EVRYTHING I EVER WANTED-----BUT SO FAR NO SIGN
OF GEORGE CLOONEY or STING!
GOOD DAY KAREN AND MARK (What a great site you've got there!)
Impatient i am! i deleted .cfg & hml and reloaded the demo so now what!
how do i go about inserting or adding Email on the form without going thru either a greater value(Mark idea) or a pipe (Karen's)
Cheers
macagy









Quote Reply
Re: ERROR RECORD In reply to
Hi macagy,

If you were able to go back to the original files, you must not have had many records to lose in your db, adding the pipe would have been quick and easy <wink>

Okay, if you're still at the start of configuring the fields, use something like this:

'Email' => [11, 'alpha', 40, 60, 0, '', ''],

Using these conventions:
'Email' => [11, 'alpha', 40, 60, 0, '', ''],
Field name - doesn't have to have the single quotes if only one word but a good idea to always use the single quotes for your field names.

'Email' => [11, 'alpha', 40, 60, 0, '', ''],
The sequential number this field has in your db. Numbering starts with [0] (first field)

It doesn't matter which position the field has in the db, it only matters that the fields are sequentially numbered as they are in the default file.

One other common error made when the default db is modified initially is not adding a comma when new fields are added. Using the last two fields of the default db as an example:

Popular => [8, 'alpha', 0, 3, 0, '', ''],
Userid => [9, 'alpha', -2, 15, 0, '', '']
);

is changed to the following when additional fields are added:

'Popular' => [8, 'alpha', 0, 3, 0, '', ''],
'Userid' => [9, 'alpha', -2, 15, 0, '', ''],
'Email' => [10, 'alpha', 40, 60, 0, '', '']
);

Hope this helps to get you started. If you run into problems, post in this thread.


Quote Reply
Re: ERROR RECORD In reply to
hi Karen,
thank you for ur reply! it worked like a charm!
my next question is can i use dbman for a combined
a} Register first(username;passw/confirm passw)autoreplied with tks u'll be gett'g your user/passw;shortly
b} on my mainpage right @Login section (Username/password)
give a choice of Add/Modify and View.(Perm is set up)
if i don't hear from you today;you have yourself a GREAT GREAT LONG WEEKEND

Cheers
macagy

Quote Reply
Re: ERROR RECORD In reply to
Hi macagy,

Yes, it is possible to do each of the two functions you've mentioned. I'd suggest first you look through the resources available to give you an idea on the various mods, etc which have already been completed.

Please remember install one mod at a time. When modifying dbman for the functionality you'd like to have on your site, complete your mods one at a time. Makes troubleshooting soooo much easier. Also keep track of what mods you have added to your scripts. Again, it makes troubleshooting easier if you are informed - and you are able to structure help requests with this info when you run into a problem.

Resources:
http://gossamer-threads.com/...pts/resources/DBMan/
This is the "official" resource center for mods and tips.

http://jpdeni.com/dbman/
JPDeni has an excellent online tutorial for both DBMan and somewhere in time, I had spotted a tutorial for a basic perl intro.

http://webmagic.hypermart.net/dbman/
LoisC has created a helpful topic index of tips, details, and help files from forum postings.

Another please remember If you run into customization problems and need assistance, first copy the files you are having problems with and save them as regular .txt files. Upload the files to your server in an area where they can be accessed from the web (usually not inside your cgi-bin)
Example: yourdomain.com/location/db.cgi.txt or
yourdomain.com/location/html.pl.txt

That simple step will likely save a couple hours of waiting for someone to reply and tell you to upload your files where they can be accessed via the web. Then, you reposting the location and waiting for someone to reply again.

<wink> Good luck - it really isn't impossible nor overwhelming. Just need to take it in steps.

Quote Reply
Re: ERROR RECORD In reply to
hi Karen,Mark & the whole gang,
i hope you all had a great weekend;mine was superbe!thanks
university started and already 3 chapters of business law to look after.TALK ABOUT A HECTIC SEMESTER!who cares i've got my chocolats!don't say BOO to my old folks i hid'em in my CPU!Yes Sir! i,ve made a customized opening behind the box;TERRIFIC.NO good for pimples that they say!!!!!!!
i'm looking to help my dad! so Come and join the party PLEEEEAASE
here i'm up to:> Create a/c and login and main menu are there now(including Email i added)thanks for that-guys-!
now why is it that the main menu has besides ADD?DEL?VIEW ALL/etc..and ADMIN! I thought only when the database manager login that admin section would showup?the same for adding a record when a register user gets in! the sections:validated and popular are visible.It shouldn't corrrect?
here is my perm; 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 = 9;
and this my database def. Database Definition
# --------------------------------------------------------
# Definition of your database. Format is
# field_name => ['position', 'field_type', 'form-length', 'maxlength', 'not_null', 'default', 'valid_expr']

%db_def = (
'ID' => [0, 'numer', 5, 8, 1, '', ''],
'Title' => [1, 'alpha', 40, 255, 1, '', ''],
'URL' => [2, 'alpha', 40, 255, 1, 'http://', '^http://'],
'Type' => [3, 'alpha', 0, 60, 1, '', ''],
'Date' => [4, 'date', 12, 15, 1, &get_date, ''],
'Category' => [5, 'alpha', 0, 255, 1, '', ''],
'Description'=> [6, 'alpha', '40x3', 500, 0, '', ''],
'Validated' => [7, 'alpha', 0, 3, 1, 'Yes', 'Yes|No'],
'Popular' => [8, 'alpha', 0, 3, 0, '', ''],
'Userid' => [9, 'alpha', -2, 15, 0, '', ''],
'Email' => [10, 'alpha', 40, 60, 0, '', '']
);
would anyone care and tell me what should be my perm if those ones are wrong!
cheeriOS
macagy


Quote Reply
Re: ERROR RECORD In reply to
hi kAREN,
IT LOOKS I'M HAVING 2 USERNAME IN THIS FORUM! please refer to MagaT and a repli to Hobo re:security mod for a user IP!
i'm stuck now and i do not know where i goofed it;i followed Hobo instructions for restricting access to my dbman and i have no clue where to start looking.JPDENI had given hers or Matts' version but the process to follow wasn't clear enough for me.the inexperienced dbman user!!
are you there today?'cause i might have another one for you and this time it should be fairly easy to answer!
Talk to you later
CheerOS
macagy