Topher wrote:
> I am trying to create an admin section for my local table tennis
> (yes, it's a manly sport I know...) site and am having trouble
> creating any databases.
>
> The code I have for doing this is as follows:
>
> ## write
>
> dbmopen (%clubs, $const_database_path."clubs", 0666);
Should better be:
dbmopen (%clubs, $const_database_path."clubs", 0666)
or die "Couldn't open database\n$!";
or something like that. That will result in an error message if e.g.
$const_database_path does not contain a valid path (which I doubt it
does, see below).
> die("club id already exists!") if ($clubs{$club_id} ne "");
>
> $clubs{$club_id} =
> $club_name."§".$club_short_name."§".$club_location 1."§".
> $club_location2."§".$club_location3."§".$club_loca tion4."§".
> $club_postcode."§".$club_map_href."§".$club_map_te xt."§".
> $club_website_href."§".$club_notes."§".$club_secre tary_name."§".
> $club_secretary_add1."§".$club_secretary_add2."§".
> $club_secretary_add3."§".$club_secretary_add4."§".
> $club_secretary_postcode."§".$club_secretaryhome_t el."§".
> $club_secretary_mobile_tel."§".$club_secretary_wor k_tel."§".
> $club_secretary_email;
Without knowing anything about the rest of your application, including
how all those variables are populated, I have a feeling that your data
structure leaves room for improvements.

But if you want advice in
that respect, you'd better explain more about what you are actually doing.
<snip>
> I have a file 'mkttl.conf', which is linked to earlier on in the
> script using require("mkttl.conf");
>
> In mkttl.conf I define $const_database_path as
> $ENV{"SITE_ROOT"}."\mkttl_concept\databases\"
That does certainly not seem to be correct. Is there really a
$ENV{"SITE_ROOT"} variable? And using backslashes within doublequotes
does likely result in something else but what you expect.
I would _guess_ that this is what you should have in mkttl.conf:
$const_database_path =
$ENV{DOCUMENT_ROOT} . '/mkttl_concept/databases/';
--
Gunnar Hjalmarsson
Email:
http://www.gunnar.cc/cgi-bin/contact.pl