My this code works perfect except Where clause
i want to send email to only people who has "No" in "ackno_a" field of the table.
Please help
<html>
<head>
<title>IT Phone List</title>
</head>
<BODY>
<?php
require_once("site_sc_fns.php");
if(empty($SEND)){$SEND="";}
switch($SEND){
case "Send":
if(!empty($MESSAGE)){
if(empty($SUBJECT)){$SUBJECT= " ";}
$HEADERS = "MIME-Version: 1.0\r\n";
$HEADERS .= "Content-type: text/html; charset=iso-8859-1\r\n";
$HEADERS .= "From: Info <Prithvi.Singh@kla-tencor.com>\r\n";
$SUBJECT = "IT Phone List Update. \r\n";
$linkID = mysql_connect("localhost", "", "");
mysql_select_db(virus, $linkID);
$obRS = mysql_query("SELECT email_g FROM phlistnew WHERE ackno_a=No ", $linkID);
while($row = mysql_fetch_row($obRS)){
foreach ($row as $field){
$email_g = $field ;
$url = "show_cat.php?email_g=" .$field ;
$MESSAGE = "<br></br>\n";
$MESSAGE .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n";
$MESSAGE .= "<tr>\n";
$MESSAGE .= "<td>Our contents here. </td>\n";
$MESSAGE .= "</tr>\n";
$MESSAGE .= "<tr>\n";
$MESSAGE .= "<td>Email Address: $email_g</td>\n";
$MESSAGE .= "</tr>\n";
$MESSAGE .= "<tr height=\"10\">\n";
$MESSAGE .= "<td height=\"10\"></td>\n";
$MESSAGE .= "</tr>\n";
$MESSAGE .= "<tr>\n";
$MESSAGE .= "click <A CLASS=TBLACK HREF=\"http://ca1dco01/virus/phonenew/$url\">here</A> to verify/update your information.<br>";
$MESSAGE .= "</tr>\n";
$MESSAGE .= "</table>\n";
mail($field, $SUBJECT, $MESSAGE, $HEADERS);
print " $field <br>" ;
}
}
// mysql_close($linkID);
echo "<hr><b>MESSAGE DETAILS</b><hr>";
echo "<b>Subject:</b> $SUBJECT<br>";
echo "<b>Message:</b> $url <br>";
}
break;
default:
echo "<FORM ACTION=itmail.php METHOD=GET NAME=FORM1 >";
echo "Please type in html code below.<BR>";
echo "<TEXTAREA NAME=MESSAGE STYLE='width:500;height:300' WRAP=off > </TEXTAREA><BR>";
echo "<INPUT TYPE=BUTTON ONCLICK=\"document.FORM1.MESSAGE.value=''\" VALUE=Reset > <INPUT TYPE=SUBMIT VALUE=Send NAME=SEND > ";
echo "</FORM>";
}
?>
</BODY></HTML>