Gossamer Forum
Quote Reply
Modify
For some reason I can't get DBMan SQL to modify records. Everything appears to be set up properly. I can add and delete records just fine. When I try to modify it pretends to be working and returns a success screen with no data displayed and the modifications do not take.

I'm also a little concerned that no documentation came with my download of DBMan SQL. I am familiar with the flat file version, but there are definite differences between the two.

Any help would be appreciated.

Quote Reply
Re: Modify In reply to
Not having worked with the SQL version, I can only guess, but when a problem like this comes up in the other version, it's often because there are fields missing in sub html_record_form. Are you sure you have all of the fields from your .cfg file in sub html_record_form?

JPD
Quote Reply
Re: Modify In reply to
Well, I used your cool configurator to create my files so I'm pretty sure I have matching fields in each.

Also when I say there is no data displayed in the success screen, I mean no data displayed for any of the fields. Totally blank. It's very wierd.

When I go back and view the record it is all there. No data is lost, it's just like my modify command is being ignored.

Quote Reply
Re: Modify In reply to
I'm afraid I can't help. I just don't know enough about SQL to be able to give you any information.

JPD
Quote Reply
Re: Modify In reply to
Thats OK. Thanks anyway! I'm trying to get in contact with Alex for some help.

I'm thinking that since there are many more users for the flat file version, perhaps the debugging and support of the SQL version is not as strong.

Quote Reply
Re: Modify In reply to
You might at least be able to figure out what the problem is, even if you can't fix it. Smile

In sub html_modify_success, the line that prints out the record is

&html_record(&get_record($in{$db_key}));

So you need to be sure that the variable $db_key is defined and that the variable $in{$db_key} is defined.

I would add a debugging line to the subroutine

Code:

print qq|--$db_key--<BR>--$in{$db_key}--|;
See what happens. You should get


--the name of your key field--
--the key value of the record you just modified--


See which one is missing.



JPD
Quote Reply
Re: Modify In reply to
Ahh! Thanks for the tip!

Very interesting! It returns the name of my key field which is "Number", as it should, but instead of the value of the key field (which should be a number) it returns my log-in name!? Yikes!

Something's definitely screwy! :-)

Quote Reply
Re: Modify In reply to
I had a similar problem to this with modify with the ID field getting filled in with the username and Alex fixed it for the site I was working on... However I don't actually know what he did.

Chris

Quote Reply
Re: Modify In reply to
Cool. Alex fixed it for me also. I thought I'd post his response just in case anyone else ever needs it:


I think I got it. In db.cgi:

# Set the userid to the logged in user.
($auth_user_field >= 0) and ($in{$auth_user_field} = $db_userid);

This was causing problems. My fault, I recently switched the sql version
to use the field name rather then the field position in the config file.