jquery countdown timer within a php loop
<p>i want to use keith woods countdown timer jquery plugin (http://keith-wood.name/countdown.html) to show the time left to bid on an auction but im having trouble with it.</p>

<p>when a user searches, php retrieves multiple search results, with a timestamp for the endtime stored as a varchar.</p>

<pre><code>while($row = $stmt-&gt;fetch(PDO::FETCH_ASSOC)){
        $numrows++;
        $ID = $row['ID'];
        $img = $row['img'];
        $desc = $row['description'];
        $name = $row['name'];
        $owner = $row['owner'];
        $cprice = $row['cprice'];
        $iprice = $row['iprice'];
        $incprice = $row['incprice'];
        $etime = $row['etime'];
        $nextBid = $cprice + $incprice;

$stmt2 = $pdo-&gt;prepare("SELECT * FROM user WHERE username = :username");
$stmt2-&gt;bindParam(":username", $owner,PDO::PARAM_STR);
$stmt2-&gt;execute();

$thisuser = $stmt2-&gt;fetch(PDO::FETCH_ASSOC);
$location = $thisuser['location'];

        echo'
        &lt;tr class="resultindex"&gt;

        &lt;td class="imgCol"&gt;&lt;a href="displayAuct.php?id='.$ID.'"&gt;&lt;img src="'.$img.'" alt="'.$name.'" /&gt;&lt;/a&gt;&lt;/td&gt;
        &lt;td class="infoCol"&gt;

            &lt;div class="nameDiv"&gt;
                &lt;a class="nameLink" href="displayAuct.php?id='.$ID.'"&gt;'.$name.'&lt;/a&gt;&lt;br/&gt;
            &lt;/div&gt;
            &lt;div class="descDiv"&gt;
                &lt;span class="priceLabel2"&gt;'.$desc.'&lt;/span&gt;
            &lt;/div&gt;

            &lt;div class="userdiv"&gt;
                &lt;span class="fromuser"&gt;Location: &lt;/span&gt;&lt;br/&gt;
                &lt;span class="location"&gt;'.$location.'&lt;/span&gt;
            &lt;/div&gt;
        &lt;/td&gt;
        &lt;td style="width:1px; background-color:#330066;" &gt;&lt;/td&gt;
        &lt;td class="priceCol"&gt;
            &lt;div class="currentp"&gt;&lt;span class="priceLabel"&gt;Current Bid: &lt;/span&gt;&lt;br/&gt;&lt;span class="price1"&gt;$'.$cprice.'&lt;/span&gt;&lt;/div&gt;
            &lt;div class="instantp"&gt;&lt;span class="priceLabel2"&gt;Instant Sale: &lt;/span&gt;&lt;br/&gt;&lt;span class="price2"&gt;$'.$iprice.'&lt;/span&gt;&lt;/div&gt;
            &lt;div style="height:5px;"&gt;&lt;/div&gt;
            &lt;div class="incp"&gt;&lt;span class="priceLabel2"&gt;Next Bid:&lt;/span&gt;&lt;br/&gt;&lt;span class="price2"&gt;$'.$nextBid.'&lt;/span&gt;&lt;/div&gt;
        &lt;/td&gt;
        &lt;td style="width:1px; background-color:#330066;"&gt;&lt;/td&gt;
        &lt;td class="timerCol"&gt;
            &lt;div id="timeRow"&gt;
                &lt;span class="timeleft"&gt;Time Left: &lt;/span&gt;
            &lt;/div&gt;
            &lt;div id="countdownRow"&gt;&lt;/div&gt;
        &lt;/td&gt;
        &lt;/tr&gt;
        ';
    }
</code></pre>

<p>at the bottom of the code, i want the countdown timer based on that particular item to be displayed in the countdownRow div.</p>

<p>i dont know how to handle this with javascript, ive come up with:</p>

<pre><code>var timestamp = &lt;?php echo $etime; ?&gt; * 1000;
    var endTime = new Date();
    endTime.setTime(timestamp);


    $(document).ready(function(e){
        $(".cdtimer").load(function(){
            $(".cdtimer").countdown({until: endTime});
        });
    });
</code></pre>

<p>but this doesnt seem to work. Anyone got an idea of what i need to do here?</p>
