You are here: Re: Double Entries « PHP SQL « IT news, forums, messages
Re: Double Entries

Posted by nobody on 08/28/06 05:10

Hi John,

Sure. Here it is. Hope this helps.

<?PHP

$connection = mysql_connect("serverhost","username","password");


if (!$connection) {
die ("Could not connect: " . mysql_error());
}else{
echo "Connected";
}

mysql_select_db("dbname", $connection);

$sql = ("INSERT INTO newsletter
(email)
VALUES
('$_POST[email]')");

mysql_query($sql,$connection);

if (!mysql_query($sql,$connection)) {
die ("Could not update" . mysql_error());
}
echo "Updated";

?>


Johnny wrote:
> <nobody@thisaddress.net> wrote in message news:BNsIg.958$N84.153@trnddc08...
>
>>Hello,
>>
>>Im learning PHP and MySQL and wrote a simple script to store an email
>>address from a Form Submit into a table. The script works, but when I
>>check the table the email address is listed twice.
>>
>>Has anybody experienced this in the past? ANy suggestions is greatly
>>appreciated. Thank you in advance for your time and words.
>>
>>George
>
> Hi George,
> You'll get more help if you post your simple script so we can see what 's
> what.
>
>

--
-------------------------------
http://www.gpalzproductions.com

"The world is full of Kings and Queens who blind your eyes and steal
your dreams. Its Heaven and Hell!" - Ronnie James Dio

 

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

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