CHECK THE BOX if you can help me.

I have a database where the rows are named “email” “instructional” “tball” “minor” “major” “prep”
The value in these are either “yes” or they are empty.

My objective is to send an email to the rows with a yes in them.

Here is the code I have thus far:

<?php <-----Line 1 $to ="[email protected]"; $subject =$_POST['subject']; $message = $_POST['body']; $username = 'sdfsdf'; $password = 'ertert'; $database = 'ertertert'; //connect to database $con=mysql_connect('', $username,$password); @mysql_select_db($database) or die("Unable to specified database"); $where = ''; if (!empty($_POST['cb']) && count($_POST['cb'])) { $where = 'WHERE yes IN ('. implode(', ', $_POST['cb']).')'; } $query = "SELECT email FROM testemail . $where"; $result=mysql_query($query) or die(mysql_error()); mysql_close($con); Here is the form: <input type=checkbox name="cb['instructional']" Here is the eror: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE yes IN (on)' at line 1

I think what you are looking for is something like:

Sponsor our Newsletter | Privacy Policy | Terms of Service