I'm not a PHP coder, but looking at you code further I presume the idea is to requery the table again using the primary key to retrive one record then use the results to get the variables that can be embedded into the URL?
With that in mind I altered my code to the following...
global $conn;
if (@$_REQUEST["editid1"])
{
$rs = db_query("select * from census1841 where Ref=".$_REQUEST["editid1"]);
$data = db_fetch_array($rs);
$Family = $data["iFamily"];
$Piece = $data["Piece"];
$str = "<input type=button class=button value='View Household' onclick=\"window.location.href='http://localhost/Yorkshire%20Indexers/census_1841_list.php?a=advsearch&type=and&asearchfield%5B%5D=Surname&asearchopt_Surname=Contains&value_Surname=&value1_Surname=&asearchfield%5B%5D=Forenames&asearchopt_Forenames=Contains&value_Forenames=&value1_Forenames=&asearchfield%5B%5D=Age&asearchopt_Age=Contains&value_Age=&value1_Age=&asearchfield%5B%5D=Born&asearchopt_Born=Contains&value_Born=&value1_Born=&asearchfield%5B%5D=Piece&asearchopt_Piece=Equals&value_Piece=".$Piece."&value1_Piece=&asearchfield%5B%5D=ED&asearchopt_ED=Contains&value_ED=&value1_ED=&asearchfield%5B%5D=Folio&asearchopt_Folio=Contains&value_Folio=&value1_Folio=&asearchfield%5B%5D=Page&asearchopt_Page=Contains&value_Page=&value1_Page=&asearchfield%5B%5D=Schedule&asearchopt_Schedule=Contains&value_Schedule=&value1_Schedule=&asearchfield%5B%5D=Street&asearchopt_Street=Contains&value_Street=&value1_Street=&asearchfield%5B%5D=Place&asearchopt_Place=Contains&value_Place=&value1_Place=&asearchfield%5B%5D=iFamily&asearchopt_iFamily=Equals&value_iFamily=".$Family."&value1_iFamily='\">";
echo $str;
}
This returns an error as soon as you enter the view.
Technical information Error type 2 Error description Missing argument 2 for db_query(), called in C:\PHPRunnerProjects\Yorkshire Indexers\output\include\census_1841_events.php on line 44 and defined URL localhost/Yorkshire Indexers/census_1841_view.php?editid1=2 Error file C:\PHPRunnerProjects\Yorkshire Indexers\output\include\dbconnection.php Error line 22 SQL query SELECT `Ref`, Schedule, Forenames, Surname, Age, Page, Folio, Piece, ED, Place, Street, iFamily, iPageCount, Notes, Born FROM `census 1841` where `Ref`=2
Any ideas?