I am trying to get the detail records to appear on a form underneath the header records with a db lookup
Code $row=$dbh->prepare("SELECT contact_id,first_name,last_name,organisation FROM tb_contacts WHERE organisation ILIKE ?"); my $cat1="%$category%"; $row->bind_param(1,$cat1); $row->execute(); print start_multipart_form (POST); while(($id,$first_name,$last_name,$organisation) = $row->fetchrow_array ()) { print "Id",textfield('id'.$id,$id); print "firstname", textfield('first_name'.$id,$first_name); print "last_name",textfield('last_name'.$id,$last_name); print "organisation",textfield('organisation'.$id,$organisation); print "<br />"; print "<br />"; [EMAIL PROTECTED](); #print @par1; #foreach $par1(@par1){ #print $par1; #} print start_multipart_form (POST); $row=$dbh->prepare("SELECT id,contact_id,type_of_contact,priority FROM tb_contact_role WHERE contact_id ILIKE ?"); my $idsel=$id; #print $id; $row->bind_param(1,$idsel); $row->execute(); while(($id1,$contact_id1,$type,$priority) = $row->fetchrow_array()) { #print $id1,$contact_id1,$type,$priority; print "Id",textfield('id1'.$id1,$id1); print "firstname", textfield('contact_id'.$id1,$contact_id1); print "last_name",textfield('type'.$id1,$type); print "organisation",textfield('priority'.$id1,$priority);} } print "Choose Id",textfield('id2','0'); print "<br />"; print "<BR />"; print submit; print end_form; This only produces on record at the top-level, if I dont have the select inside the loop, then all matching records appear Anyone any idea where I am going wrong -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>