[SOLVED] Unexpected $ that won't go away
Posted: Fri Mar 11, 2005 11:02 am
I am making a webpage so that you can select a company and then select an employee from the database.
That part worked fine.
Next, I wanted to check if the company even HAD members and if not, don't show them.
I stumbled upon some troubles, but it seemed to be going alright.
But then, I had an unexpected $.
Now, I've searched the board, and it appears that it happens when you don't close your code right.
So I checked my code, saw that it in fact didn't have such a close tag and added it.
The error stayed.
Now, I've tried placing the close bracket somewhere else, remove the echo I had just added and even commented the if.
The error STAYS.
This is my code now:
Please help. 
That part worked fine.
Next, I wanted to check if the company even HAD members and if not, don't show them.
I stumbled upon some troubles, but it seemed to be going alright.
But then, I had an unexpected $.
Now, I've searched the board, and it appears that it happens when you don't close your code right.
So I checked my code, saw that it in fact didn't have such a close tag and added it.
The error stayed.
Now, I've tried placing the close bracket somewhere else, remove the echo I had just added and even commented the if.
The error STAYS.
This is my code now:
Code: Select all
<html>
<head>
<title>Testsite</title>
</head>
<body>
<form method="post" action="tabel.php">
<?php include("connect.php");
$Database=mysql_query("SELECT * from Lid_Hdr");
?>
<table border=0>
<tr>
<th width=250 align="left">Lidbedrijf:</th>
<th width=250 align="left">
<select name="LidBedrijf" OnChange="submit();">
<?php
while($rij=mysql_fetch_array($Database))
{
echo "<option value=\"";
echo $rij["LidHdrNr"]."\"";
if($LidBedrijf==$rij["LidHdrNr"]){echo "selected";}
echo ">";
echo $rij["LidRoepNaam"]."</option>\n";
}
?>
</select>
</th>
<tr>
<th width=250 align="left">Medewerker:</th>
<th width=250 align="left">
<select name="MedeWerker" OnChange="submit();">
<?php
if ($LidBedrijf)
{
$Database2=mysql_query("SELECT * from Mw_Hdr where LidHdrNr = '$LidBedrijf';");
while($Rij2=mysql_fetch_array($Database2))
{
echo "<option value=\"";
echo $Rij2["MwHdrNr"]."\"";
if($MedeWerker==$Rij2["MwHdrNr"]){echo "selected";}
echo ">";
echo $Rij2["MwRoepnaam"]."</option>\n";
}
}
?>
</select>
</th>
<th width=250 align="left"><input type="submit" name="KnopNieuw" value="Nieuw"></th>
</table>
<hr align="left" width=600>
<?php
$Database3=mysql_query("SELECT * from Mw_Hdr where MwHdrNr=$MedeWerker");
$Rij3=mysql_fetch_array('$Database3);
if ($LidBedrijf and !$MedeWerker[$Rij2])
{
?>
<table border=0>
<tr>
<th align=left width=150>Voornaam</th>
<th align=left>
<?php
echo "<input type=\"text\" name=\"TxtVoornaam\"";
echo "value=".$Rij3["MwVoornaam"].">";
?>
</th>
</tr>
<tr>
<th align=left width=150>Tussenvoegsel</th>
<th align=left>
<?php
echo "<input type=\"text\" name=\"TxtTussenvoegsel\"";
echo "value=".$Rij3["MwTussenvoegsel"].">";
?>
</th>
</tr>
<tr>
<th align=left width=150>Achternaam</th>
<th align=left>
<?php
echo "<input type=\"text\" name=\"TxtAchternaam\"";
echo "value=".$Rij3["MwAchternaam"].">";
?>
</th>
</tr>
<tr>
<th align=left width=150>Voorletters</th>
<th align=left>
<?php
echo "<input type=\"text\" name=\"TxtVoorletters\"";
echo "value=".$Rij3["MwVoorletters"].">";
?>
</th>
</tr>
<tr>
<th align=left width=150>Geslacht</th>
<th align=left>
<?php
echo "<input type=\"text\" name=\"TxtGeslacht\"";
echo "value=".$Rij3["MwGeslacht"].">";
?>
</th>
</tr>
</table>
<?php } ?>
<br>
<input type="submit" name="knop" value="Klik op mij!">
</form>
</body>
</html>