Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [jean] Build select menu from other table

Quote Reply
Re: [jean] Build select menu from other table In reply to
Thanks for the quick reply! I modified your subroutine by changing your references to Column1 and Column2 to First_name and Last_name, which correspond to column names in my contacts table. I wasn't sure where I should stick this subroutine, so I put it in HTML.pm and I named it sub build_contact_select. Then, in one of my templates (add_form.html), I tried calling the new subroutine with the following command:

<%Dbsql::HTML::build_contact_select%>

But the browser displays the following text in the place where the select menu should appear:

Error: Unable to load module: Dbsql::HTML. Reason:
Error: No subroutine 'Dbsql::HTML::build_contact_select' in 'Dbsql/HTML.pm',
Error: No subroutine 'Dbsql::HTML::build_contact_select' in 'Dbsql.pm'


When I run the Emacs Perl debugger on the HTML.pm file, I get the following warning:
Global symbol "$DB" requires explicit package name at /path-to-DBSQL-directory/admin/Dbsql/HTML.pm line 206.

Does this mean that the scalar $DB needs to be replaced by a package name? Being a newbie, I tried replacing it with a couple of package names like GT::CGI and GT::SQL::Table, but each time I get the fatal error screen with the first line that reads:

Unknown method 'table' called at /path-to-DBSQL-directory/admin/Dbsql/HTML.pm line 206.

Sorry for opening this can of worms, but there are probably other users who would benefit from learning this procedure. It's probably very simple, but I'm still trying to get familiar with all the different files and what they do.
Subject Author Views Date
Thread Build select menu from other table Halito 5372 Mar 1, 2002, 10:05 AM
Thread Re: [Halito] Build select menu from other table
jean 5238 Mar 1, 2002, 11:00 AM
Thread Re: [jean] Build select menu from other table
Halito 5249 Mar 2, 2002, 10:26 AM
Thread Re: [Halito] Build select menu from other table
jean 5269 Mar 2, 2002, 11:12 AM
Post Re: [jean] Build select menu from other table
Halito 5226 Mar 3, 2002, 10:46 AM
Post Re: [Halito] Build select menu from other table
LanceWilson2 4970 Mar 5, 2003, 3:07 PM