Need a little help here with the following:
I am using Jodometer to create a up counting odometer which has the 100% effect that I need in looks and functionality.
I need to be able to call the starting value out of a MYSQL database.
Any ideas? Source code included:
HTML Code:<?php $con = mysql_connect("localhost","geewizz_counter","cardiff1984"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("geewizz_counter", $con); $result = mysql_query("SELECT * FROM counternumber"); echo "<table border='1'> <tr> <th>number</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['number'] . "</td>"; echo "</tr>"; } echo "</table>"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Web Counter - Gee Wizz Designs</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="jquery-1.2.6.min.js" type="text/javascript"></script> <script src="gwd_counter.js" type="text/javascript"></script> <script type="text/javascript"> window.onload = function() { document.getElementsByTagName('p').style.background = 'red'; } </script> <script> . . . document.write( <?php echo $row[number]; ?>); . . . </script> <script type="text/javascript"> $(function(){ $('.counter2').jOdometer({ increment: 1.8, formatNumber: true, counterStart:'21200000', numbersImage: 'images/numbers.png', spaceNumbers: 2, formatNumber: true, commaImage: 'images/comma.png'}) }); </script> <style type="text/css" media="screen"> .counter2{ width:200px; height:31px; border:1px solid #4D4D4D; overflow:hidden; position:relative; background-color:#4D4D4D; } </style> </head> <body> <br><br><br> <table border="0" bgcolor="#4D4D4D"> <tr> <td align="right"><img src="images/pound.png"/></td> <td align="left"><div class="counter2"></div></td> </tr> </table> </body> </html>


Reply With Quote
Bookmarks