Question : insert record and check for existing email address

How can I run an INSERT query and SELECT together? If the email address already exists then it won't insert but if it doesn't exist then it will insert.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
<?php
if (isset($_POST['submitted'])) {
session_start();
$dbc = mysql_connect('localhost', 'root', 'root')
or die('Failed to connect to MYSQL Server');
mysql_select_db("test", $dbc);
$email = mysql_real_escape_string(trim($_POST['email']), $dbc);
$_SESSION["email"] = $email;
$query = "INSERT INTO download (email) VALUES ('$email')";
$result = mysql_query($query, $dbc)
or die (mysql_error($dbc));
mysql_close($dbc);
Header( "Location: thanks.php" ); 
exit;
}
?>

Answer : insert record and check for existing email address

can u please more ur question more clear
are u trying to filter ur grid based on a date
Random Solutions  
 
programming4us programming4us