PHPBuilder - Simple table update in while loop

RSS Twitter
Snippets Databases

Simple table update in while loop

by: Jorge
November 3, 2001

Version: 1

Type: Sample Code (HOWTO)

Category: Databases

License: GNU General Public License

Description: an easy way to update a row in a while loop.

$email_query="select * from email";

if ($send == 2) {
print("<p>Email being cleared");
while ($email=mysql_fetch_row($email_result)) {

if ($email[1] == 'y') { 
 $email_mysql_query = ("UPDATE email SET sent='n' WHERE id = $email[3]"); 
 $email_mysql_query_result = mysql_query($email_mysql_query); 
 print ("<p>email cleaned"); 


Comment and Contribute

Your comment has been submitted and is pending approval.




(Maximum characters: 1200). You have characters left.