From: x2000habouzit Date: Tue, 2 Nov 2004 14:13:13 +0000 (+0000) Subject: dedicqted to yann X-Git-Tag: xorg/old~1086 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=389de251e8e95044198f0e7cbdf0d3855799489b;p=platal.git dedicqted to yann how to take the line in MySQL thqt minimize a constraint --- diff --git a/scripts/cron/send_nl.php b/scripts/cron/send_nl.php index 79d32e6..b30cdce 100755 --- a/scripts/cron/send_nl.php +++ b/scripts/cron/send_nl.php @@ -19,7 +19,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: send_nl.php,v 1.5 2004-11-02 11:34:17 x2000habouzit Exp $ + $Id: send_nl.php,v 1.6 2004-11-02 14:13:13 x2000habouzit Exp $ ***************************************************************************/ require('./connect.db.inc.php'); @@ -50,8 +50,10 @@ while(true) { $sql = mysql_query("SELECT ni.user_id,ni.pref, a.alias, u.prenom,u.nom, FIND_IN_SET(u.flags, 'femme') FROM newsletter_ins AS ni INNER JOIN auth_user_md5 AS u USING(user_id) - INNER JOIN aliases AS a ON(u.user_id=a.id AND a.type='a_vie') - WHERE ni.last<$id + INNER JOIN aliases AS a ON(u.user_id=a.id AND a.type!='homonyme') + LEFT JOIN aliases AS b ON(u.user_id=b.id AND a.type!='homonyme' + AND LENGTH(a.alias)>LENGTH(b.alias)) + WHERE b.alias IS NULL AND ni.last<$id LIMIT 60"); if(!mysql_num_rows($sql)) exit(0); $sent = Array();