Reply to Re: Double Entries

Your name:

Reply:


Posted by Neil Trigger on 08/29/06 19:21

yeah just put "or die" after one interation, rather than do it again.

PHP is funny like that. I was always making that mistake when i first
started.

--
Neil Trigger
Magic2k Manager
http://www.magic2k.com
http://www.oddmap.com
<nobody@thisaddress.net> wrote in message
news:iDGIg.4404$pX3.2414@trnddc07...
> Oh, OK. Yes that would make sense. I thought I was testing for a return
> value in the if statement. Didn't realize I could do both at once. I'll
> drop the first query. Thanks Andy and John for your assistance.
>
> Johnny wrote:
> > <nobody@thisaddress.net> wrote in message
> > news:44F27A73.8000102@thisaddress.net...
> >> 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";
> >>
> >> ?>
> > loks like you have called 'mysql_query($sql,$connection)' twice to
> > me....that might explain the double entry.

[Back to original 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

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