I have a table like this :
+-------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+----------+------+-----+---------+----------------+
| id | int(11) | | PRI | 0 | auto_increment |
| isim | char(26) | YES | | NULL | |
| email | char(30) | YES | | NULL | |
+-------+----------+------+-----+---------+----------------+
I take email address from web with php..
I want to control inserting email address..
I want to insert the same address only one time.
my code:
...................
mysql_connect(.............) or die("veritabanina baglanilamadi");
mysql_select_db("db_edakom");
$result = mysql_query ("select * from email2");
if ($email == mysql_fetch_array ($result)) {
echo "Bu email adresi daha once girilmistir.";
echo 'tekrar denemek icin <a href="javascript:history.go(-1)
>tiklayiniz.</a>';
}
else {
$query = "insert into email2 values('', '$isim','$email')";
mysql_query($query) or die("Cant insert data!");
print "Islem tamamlandi";
mysql_close();
}
HOW CAN I DO THIS?
Edakom Internet Sorumlusu
Gokce Akkaya