I am having a little problem getting a link generated by php to display a certain field with a space in it. Basically I am pulling a particular column called department from the database and printing all the entries as an array to generate the links. However if the department is more than one word the link comes out as .php?department=A instead of .php?department=A Department
Any ideas?
//Keep the department from printing multiple times.
if ($myrow = mysql_fetch_array($result)) {
$departments = array();
do {
if ((!in_array($myrow["department"], $departments))) {
$departments[] = $myrow["department"];
}
} while ($myrow = mysql_fetch_array($result));
}
//Print the array.
foreach($departments as $department) {
echo "<tr><td width=140><a href=list.php?department=$department target=mainFrame class=menulink class=&{ns4class};>".$department."</a></td>";
}