Scan through a table
I have a email table (to, email, subject , ect.) and already have the php code to send may from a record of the table.
Now I need a way to scan the table and execute mycode to build email from each row of the table.
Scan table email where sent = 0
Is there any hint about this issue ?
select * from <table name> where `sent` = 0
Thats the SQL you'd need.
I don't think so. I have to go through the table looking for sent = 0 condition and executing a code at every row where sent = 0 and replacing sent with 1.
Originally Posted by tangoforce
As far as a know, select will just return list of data.
That's the point of the SQL. The WHERE condition is searching for the condition of 0 or false being set to the property sent. You can then iterate the records or add them to carbon copies or whatever.
Ok you clearly know best so why not go away and work it out yourself then? - Clearly my advice is inferior :rolleyes:
Originally Posted by moisesbr
If you don't want to run any php on the records you could just run SQL that will change it all:
update <table name> set `sent` = 1 where `sent` = 0
I promise I won't try to assist again..