calling single javascript function for each php variable fetched from database, multiple countdown program
<p>I am trying to get a multiple countdown system, event day and minutes being fetched from database. There can be many such events. After getting the event date, i pass this values to a javascript function which on client side runs for every 1 sec using the setTimout function. This works fine for one event. However for many events how do i achieve the same functionality. i.e i want to run the javascript function for each event.</p>

<p>I am getting some php variables from database. eg</p>

<pre><code>while($row = mysql_fetch_array($query)){
$a = $row['day'];
$b = $row['minutes'];
</code></pre>

<p>}</p>

<p>Now i need to pass all this values inside a javascript function.
If there were only one event, i could directly pass the php values. But for multiple events i am confused as to what to do. I tried using a javascript function inside the while loop, but i get function not defined error, and that is obvious because php is run before javascrip. Any logic, or help appreciated.</p>

<p>Thanks</p>
