Re: If statement duplicating mysql records?

From: Date: Wed, 20 Jun 2007 15:12:55 +0000
Subject: Re: If statement duplicating mysql records?
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-257497@lists.php.net to get a copy of this message
On 6/20/07, Jason Pruim <japruim@raoset.com> wrote:
Hey Jim, You're right it is the system you helped me get started with, Just wanted to add a little color coding for the different levels :) Here is the sql query: $sql = "SELECT * FROM tasks WHERE completed='0' order by id"; $sql .= " AND (day_of_week BETWEEN '0' AND '".$dow."')";
Sure, give Jim the credit. Now you're uninvited from the wedding! ;-P Try rewriting your SQL query:
       $sql  = "SELECT * FROM tasks WHERE completed='0'";
       $sql .= " AND (day_of_week BETWEEN '0' AND '".$dow."')";
       $sql .= " ORDER BY id";
Looks like you even kept the variables and statements pretty much the same. Glad to see it's working out for you out-of-the-box, for the most part. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107

« previous php.general (#257497) next »