Hi there,
some days before, JPDeni wrote, she would like to read any experience with her relational dbman manual,before she would provide it again .
Here are my test-results:
It works great in it's special way !
After correcting some syntax (typing) errors, the code works in both directions.
I created a 'User.db' and a 'item.db'
they are linked by the UserId-field, which is the keyfield in the user-db.
Okay, getting inforamtion from user-db in displayed records of the item db is not a problem, it's working fine.
Getting a list of the actual items of the user in the displayed user record is working fine -if I'm searching for only one user.
And here is the problem:
Searching for more than one user displays after each record the whole list of items:
example:
user 1,Street, state, city
List of items:
item user1
item user2
item user3
User 2,street, state, city
List of items:
item user1
item user2
etc...
If anybody is interested to answer, here are my questions:
How can i get the items for each user in alist after the user information?
I understood, this part of code will work with every record, because it is placed in html_record, which is called by the db.cgi for every user record.
I tried to put the code in the sub view_records in db.cgi but it didn't work. the debugging reported missing formfields, i understood that the code must be in between a html "form" tag.
Maybe the problem is solved if thecode is placed somewhere else, but after doing some trial and error i give up now....
the code for getting records from the item-db is placed in html.pl: 'html_record_long'
&switch_to_item;
$rec{'USERID'} = $in{'USERID'};
$in{'mh'} = 100;
my ($status2,@hits2) = &query("view");
# this part displays the item records in as #a list
if ($status2 eq "ok") {
my ($numhits2) = ($#hits2+1) / ($#db_cols+1);
print "<table>";
for (0 .. $numhits2 - 1) {
%rec2 = &array_to_hash($_, @hits2);
print qq|
<tr><td>
<a href="$db_script_url?db=item&uid=$db_uid&ID=$rec2{'ID'}&view_records=1">$rec2{'ID'} $rec2{'ITEM'}</a><BR>
</td></tr>|;
print "</table>";
}
}
&switch_to_user;
Another question:
Is there a way ti build a search which is searching in both dbs for the searchterm and displaying the results in one result-table(page)??
thank you for your helping, maybe Elliot knows an answer or JPDeni comes back soon and knows any answers ?
Thanks again
bek
some days before, JPDeni wrote, she would like to read any experience with her relational dbman manual,before she would provide it again .
Here are my test-results:
It works great in it's special way !
After correcting some syntax (typing) errors, the code works in both directions.
I created a 'User.db' and a 'item.db'
they are linked by the UserId-field, which is the keyfield in the user-db.
Okay, getting inforamtion from user-db in displayed records of the item db is not a problem, it's working fine.
Getting a list of the actual items of the user in the displayed user record is working fine -if I'm searching for only one user.
And here is the problem:
Searching for more than one user displays after each record the whole list of items:
example:
user 1,Street, state, city
List of items:
item user1
item user2
item user3
User 2,street, state, city
List of items:
item user1
item user2
etc...
If anybody is interested to answer, here are my questions:
How can i get the items for each user in alist after the user information?
I understood, this part of code will work with every record, because it is placed in html_record, which is called by the db.cgi for every user record.
I tried to put the code in the sub view_records in db.cgi but it didn't work. the debugging reported missing formfields, i understood that the code must be in between a html "form" tag.
Maybe the problem is solved if thecode is placed somewhere else, but after doing some trial and error i give up now....
the code for getting records from the item-db is placed in html.pl: 'html_record_long'
&switch_to_item;
$rec{'USERID'} = $in{'USERID'};
$in{'mh'} = 100;
my ($status2,@hits2) = &query("view");
# this part displays the item records in as #a list
if ($status2 eq "ok") {
my ($numhits2) = ($#hits2+1) / ($#db_cols+1);
print "<table>";
for (0 .. $numhits2 - 1) {
%rec2 = &array_to_hash($_, @hits2);
print qq|
<tr><td>
<a href="$db_script_url?db=item&uid=$db_uid&ID=$rec2{'ID'}&view_records=1">$rec2{'ID'} $rec2{'ITEM'}</a><BR>
</td></tr>|;
print "</table>";
}
}
&switch_to_user;
Another question:
Is there a way ti build a search which is searching in both dbs for the searchterm and displaying the results in one result-table(page)??
thank you for your helping, maybe Elliot knows an answer or JPDeni comes back soon and knows any answers ?
Thanks again
bek