PHP-Linking forms Using ID
<p>I have a database in which I have a main form that list all personnel using this code</p>

<pre><code>&lt;?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("datatest", $con);
$result = mysql_query("SELECT * FROM Personnel");
echo "&lt;TABLE BORDER=2&gt;";
echo"&lt;TR&gt;&lt;TD&gt;&lt;B&gt;Name&lt;/B&gt;&lt;TD&gt;&lt;B&gt;Number&lt;/B&gt;&lt;TD&gt;&lt;B&gt;View&lt;/B&gt;&lt;TD&gt;&lt;/TR&gt;";
while ($myrow = mysql_fetch_array($result))
{
echo "&lt;TR&gt;&lt;TD&gt;".$myrow["Surname"]." ".$myrow["First Names"]."&lt;TD&gt;".$myrow["Number"];
echo "&lt;TD&gt;&lt;a href=\"childdetails.php?EmployeeID=".$myrow["EmployeeID"]."\"&gt;View&lt;/a&gt;";
}
echo "&lt;/TABLE&gt;";
?&gt;
&lt;/HTML&gt;
</code></pre>

<p>As you can note I have a link to view details of the person but when I click on the VIEW link I get the following error</p>

<p>Parse error: syntax error, unexpected 'EmployeeID' (T_STRING) in C:\Program Files\EasyPHP-12.1\www\my portable files\dss4\childdetails.php on line 6 
The childdetails.php has the following code</p>

<pre><code>&lt;HTML&gt;
&lt;?php
$db = mysql_connect("localhost", "root", "");
mysql_select_db("datatest",$db);
$result = mysql_query("SELECT * FROM children; 
WHERE "EmployeeID="["$EmployeeID"],$db);
$myrow = mysql_fetch_array($result);
echo "Child Name: ".$myrow["ChildName"];
echo "&lt;br&gt;Mother: ".$myrow["Mother"];
echo "&lt;br&gt;Date of Birth: ".$myrow["DateOfBirth"];
?&gt;
&lt;/HTML&gt;
</code></pre>

<p>Since the first form to list the personnel works I believe the problem is in childdetails.php on line 6 as returned by the server but I simply don’t know how to fix it.</p>

<p>Note: a person can have more than one child as well as having more than one wife
Help please</p>
