You are here: Re: can any one help me with this Thanks « PHP SQL « IT news, forums, messages
Re: can any one help me with this Thanks

Posted by J.O. Aho on 10/14/63 11:32

annie wrote:
> Looking to have this do a lookup into the db
> Before it does the insert
> If $email2 AND $site are in the data base stop tell the user he/she is
> already entered.
> If does not exisit then do the insert and send the email.
>
> I have tried but failed


<?PHP
include "common.php";
$email2= $_POST['email'] ;
$site= $_POST['site'] ;
$link = mysql_query($sql,$cn);

$check_sql="SELECT id FROM contest WHERE email='$email2' link='$site'";
$result=mysql_query($check_sql);
if(mysql_num_rows($result,$link)) {
/* There are one or more rows with the same email and site */
echo "Sorry, you already sent it<br>\n";
} else {
/* There are 0 such rows that has both email and site */
echo "Add your code for sending the mail<br>\n";
}
?>


//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация