tifatima Posted December 11, 2012 Share Posted December 11, 2012 (edited) Please help me with my script. In another forum, I have read that it is impossible to have Javascript work in a PHP loop. What i wanted to do is to select only the products that has the status of live and output it in my webpage. The thing is, it outputs the values I retrieved from the database but the countdown timer only works in one product. Another problem of mine is that the onmouseover doesn't work at all. Please help me on how to solve those problems. Thank you! [/font] [font=Verdana, sans-serif]<?php $howmany = mysql_query("SELECT * FROM product WHERE status = 'LIVE'"); $nrow = mysql_num_rows($howmany); for($i = 0; $i < $nrow; $i++){ $row = mysql_fetch_array($howmany); $pname = $row[1]; $closedate = $row[4]; $img = $row[10]; ?> <td align='center'> <table background="images/auctionbox.gif" width="170" height="330"> <tr> <td align="center"><?php echo $pname; ?></td> </tr> <tr> <td height="50px" align="center" width="50px"><img src="<?php echo $img; ?>"></td> </tr> <tr> <td align="center"> <script language="Javascript"> TargetDate = "<?php echo $closedate ?>"; CountActive = true; CountStepper = -1; LeadingZero = true; DisplayFormat = "%%D%%d %%H%%:%%M%%:%%S%%"; FinishMessage = "CLOSED!"; </script> <script language="Javascript" src="includes/countdown.js"></script> </td> </tr> <tr> <td align="center">P<label id="this">1.00</td> </tr> <tr> <td align="center">Last Bidder</td> </tr> <tr> <td align="center"> <script type="Javascript" src="includes/idkthis.js"></script> <a onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('BidButton','','images/bid-login.gif',1)" href="login"> <img name="BidButton" onload="MM_preloadImages('images/bid-login.gif')" width="90" height="40" src="images/bid-bid.gif"></a> </td> </tr> </table> </td> <?php } ?> Edited December 11, 2012 by tifatima Quote Link to comment https://forums.phpfreaks.com/topic/271865-help-with-the-onmouseover-and-countdown-timer/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.