Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Nov 2009
    Posts
    75
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Scan through a table

    Hi

    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.

    Something as

    Scan table email where sent = 0

    Is there any hint about this issue ?

    Moises

  2. #2
    Master Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    5,119
    Thanks
    110
    Thanked 602 Times in 589 Posts
    select * from <table name> where `sent` = 0

    Thats the SQL you'd need.
    Quote Originally Posted by deathshadow View Post
    So seriously, loosen up that tie, let out the belt, and try relating to normal people on the street instead of the gentleman's club crowd.

  3. #3
    New Coder
    Join Date
    Nov 2009
    Posts
    75
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tangoforce View Post
    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.

    As far as a know, select will just return list of data.

  4. #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    17,025
    Thanks
    4
    Thanked 2,668 Times in 2,637 Posts
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  5. #5
    Master Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    5,119
    Thanks
    110
    Thanked 602 Times in 589 Posts
    Quote Originally Posted by moisesbr View Post
    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.

    As far as a know, select will just return list of data.
    Ok you clearly know best so why not go away and work it out yourself then? - Clearly my advice is inferior

    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..
    Quote Originally Posted by deathshadow View Post
    So seriously, loosen up that tie, let out the belt, and try relating to normal people on the street instead of the gentleman's club crowd.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •