.Darkman Posted February 27, 2008 Share Posted February 27, 2008 Hello, The counter on the homepage of http://www.deviantart.com/ looks great. The one which reads "XX Deviations". It constantly updates. I suppose, it uses AJAX. Can any help me create one like this ? (i.e) I'd like to fetch the COUNT() of something from the database and display it... Thanks, Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted February 27, 2008 Share Posted February 27, 2008 yes its just a simple query you can use a second page to do this that just outputs deviations: COUNTS and just have it do <?php $q = " Select count(*) from `table`"; $r = mysql_query($q) or die(mysql_error()); echo "Deviations: ".mysql_result($r,0); ?> and then in the javascript just update the inner html of that div every X seconds Quote Link to comment Share on other sites More sharing options...
.Darkman Posted February 27, 2008 Author Share Posted February 27, 2008 and then in the javascript just update the inner html of that div every X seconds How is that done ? I put the above code in a separate file... ? Then, whats next ? Thanks Quote Link to comment 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.