Gossamer Forum
Home : Products : DBMan : Installation :

Can't MODIFY

Quote Reply
Can't MODIFY
Hi, My weekend has gone and I still cannot work it out. HELP! HELP! HELP! PLEASE!

WHEN ADDING (it memorises the entry but gives an error):
"The following record was successfully added to the database: Odd number of elements in hash list at e:/InetPub/vs205006/cgi-bin/html.pl line 92."

WHEN MODIFYING:
"Error: Unable to Modify Record
There were problems modifying the record: 1 (can't find requested record)"

THIS IS IN A NEW DATA BASE:
Books|1|Nightmare|Terror on Perl Street|20.00|1|http://www.| ||

FILES ARE AT:
http://www.nushapemall.com/default_db.txt
http://www.nushapemall.com/default_cfg.txt
http://www.nushapemall.com/html_pl.txt
http://www.nushapemall.com/db_pl.txt

Much appreciated,
Gabby

------------------
Quote Reply
Re: Can't MODIFY In reply to
You problem is that the numbers for your fields in the %db_def hash are NOT numbered correctly. Your first field MUST be 0 and then the rest of your fields incremented by 1.

So, your database definition hash should look like the following:

Code:
category => [0, 'alpha', 12, 12, 1, '', ''],
stock => [1, 'numer', 4, 4, 1, '', ''],
ItemName => [2, 'alpha', 20, 40, 1, '', ''],
description => [3, 'alpha', '40x3', 500, 1, '', ''],
price => [4, 'alpha', 8, 30, 1, '', ''],
shipping => [5, 'numer', 2, 2, 0, '', ''],
image => [6, 'alpha', 50, 150, 0, 'http://www.nushapemall.com.au/cgi-bin/mall/merchant1/db/xyz.gif'],
option1 => [7, 'alpha', 15, 100, 0, '', ''],
option2 => [8, 'alpha', 15, 100, 0, '', ''],
option3 => [9, 'alpha', 15, 100, 0, '', '']

Another problem is that you have specified the $db_key_track to be active, which could also be throwing things off.

Typically, you should associate your records with a specific number and then have it tracked in order to reduce duplicate entries. I don't know why you do not have an ID field. But anyway...try re-numbering your fields like I mentioned above and see if that solves the problem.

If it doesn't, you should add an ID field at the beginning of the list and have this automatically generated (-1) and have it be a number field (numer). Then re-number the fields again.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Can't MODIFY In reply to
Also, there are some problems I think with your image field. I would recommend formating it in the following manner:

Code:
image => [6, 'alpha', 40, 255, 1, '', ''],

That field is missing the ending '' for the regular expression of this field. If you want to have a regular expression for this field and if you are typing in individual images for records (which I would not recommend if you have particular images associated with different values for your records...this can be done differently), I would use the following configurations for that field:

Code:
image => [6, 'alpha', 40, 255, 1, '', '^http://'],

If you want a default value for that value, which is the first set of single quotes, then use the following codes:

Code:
image => [6, 'alpha', 40, 255, 1, 'http://', '^http://'],

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us