note 55688 rejected from function.mysql-affected-rows by vincent

From: Date: Wed, 10 Aug 2005 17:00:40 +0000
Subject: note 55688 rejected from function.mysql-affected-rows by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-93385@lists.php.net to get a copy of this message
Note Submitter: yaffalandis at yahoo dot com ---- when i used the following lines of code what i realized is that my lat/lon fields were being updated with the same content. why is this? $link = mysql_connect("localhost", "user", "pass") or die("Could not connect: " . mysql_error()); mysql_selectdb("db",$link) or die ("Can\'t use server : " . mysql_error()); $query = "SELECT * FROM db"; $result=mysql_query($query); $num=mysql_numrows($result); if (!$query) { die("Could not query:" . mysql_error()); } $i=0; while ($i < $num) { $address=mysql_result($result,$i,"address"); echo "addy: <b>$address</b><br>"; $query2 = urlencode($address); echo "encoded addy: <b>$query2</b><br>"; $url = "http://localhost.?address=$query2"; echo "url: <b>$url</b><br>"; $geo = new geoCodeUS; $geo->getlatlon($query2); #mysql_query("UPDATE db SET address= '$address' WHERE completed = 'no'") or die ("Insert Error: ".mysql_error());("Insert Error: ".mysql_error()); mysql_query("UPDATE db SET lat= '$geo->lat' WHERE completed = 'no'") or die ("Insert Error: ".mysql_error());("Insert Error: ".mysql_error()); mysql_query("UPDATE db SET lon = '$geo->lon' WHERE completed = 'no'") or die ("Insert Error: ".mysql_error());("Insert Error: ".mysql_error()); mysql_query("UPDATE db SET completed = 'yes' WHERE completed = 'no'") or die ("Insert Error: ".mysql_error());("Insert Error: ".mysql_error()); $i++; } any ideas? please email yaffalandis@yahoo.com

« previous php.notes (#93385) next »