Page 1 of 1

altering columns

Posted: Sun Aug 07, 2005 6:32 pm
by taldos
Since I don't want to have my server take 5 hours to send out emails to all members in a database set, I am using cron to run scheduled php files.

As a result I have been forced to create a table as follows

---------alert_sent | owner_id
______________|____________
row1
row2
row3

using:

Code: Select all

"SELECT t1.owner_id, t2.email 
FROM table1 AS t1
LEFT JOIN table2 AS t2 ON t1.owner_id = t2.id
WHERE t1.alert_sent = 0";
what I would like to do is to reset the entire "alert_sent" column to "1" once I have sent the emails. I know I can loop through individual row, but I'm sure there must be a way to just reset the column to 0 for every row.

Posted: Sun Aug 07, 2005 6:55 pm
by feyd

Code: Select all

UPDATE tableName SET fieldName = 'value'
no where clause required if you want to hit all records.