I'm doing a script that display a list of checkboxes containing data stored in my database: email_list
table.
My script:
<img src="blankface.jpg" width="161" height="350" alt="" style="float:right" />
<img name="elvislogo" src="elvislogo.gif" width="229" height="32" border="0" alt="Make Me Elvis" />
<p>Please select the email addresses to delete from the email list and click Remove.</p>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> ">
<?php
$dbc= mysqli_connect('localhost', 'root', '', 'elvis_store')
or die('Error connecting to MySQL server.');
$query = "SELECT * FROM email_list";
$result = mysqli_query($dbc, $query)
or die('Error querying database');
while($row = mysqli_fetch_array($result)) {
echo '<input type="checkbox" value="' . $row['id']'" name="todelete[]" />';
echo $row['firstname'];
echo $row['lastname'];
echo $row['email'];
echo '<br />';
}
mysqli_close($dbc);
?>
<input type="submit" name="submit" value="Remove" />
</form>
While I'm running this script, it display a Parse error:
Parse error: syntax error, unexpected ''" name="todelete[]" />'' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';' in C:\wamp\www\removeemail.php on line 16
I don't get this problem.