Re: Is it safe to do this?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That depends on what you're doing. Here's why I can't provide feedback:
1) Your code isn't at all complete, the foreach isn't even finished.
2) Where does the $addresses variable come from and what are you trying todo with it?
3) What is the mysql table and its columns supposed to represent?
4) What is this code supposed to accomplish?


Jerry wrote:

Hi,

Is it safe to do this:

<snip>

    foreach ($addresses as $email) {
        $body = str_replace($email, $comp_uri, $body);
   mysql_query ("update users SET email_setting='-1'
WHERE email='$email'") or die ("Can't set
email_setting");
   mysql_query ("UPDATE users SET email_setting='-1'
WHERE email_setting > -5") or die ("Unable ");

</snip>

Or would I be better to do this?:

<snip>

    foreach ($addresses as $email) {
        $body = str_replace($email, $comp_uri, $body);
   mysql_query ("update users SET emailerror='+1'
WHERE email='$email'") or die ("Can't update
email_setting");
   mysql_query ("UPDATE users SET email_setting='-1'
WHERE emailerror > 5") or die ("Unable ");

</snip>

Suggestions welcome.

Jerry

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com


--
--
paperCrane <Justin Patrin>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux