-
Javascript + PHP = Count Rows
Hi I am currently working on a project, where I need to count in an ajax/javascript way to show when a new row is added, without the user having to refresh the page.
As we use MySQL, PHP5 and we already use some javascript, I am wondering how I would get it to show a counter like http://www.twitpocalypse.com/
But instead of all being Javascript, it would count how many rows are in the DB.
The table that we want to get the data out of is named entry
Thanks
The web in one word.
-
-
Ajax is just a method to get data from PHP. Simply put, you need to just design a script in php that will return the number of rows, request that with Ajax, and display that value in Javascript. It shouldn't be too difficult if you've already got most of it setup, but you will need to worry about security issues (because Ajax requests are made the same way anyone could request that PHP script, so be sure it doesn't reveal anything you don't want to be public knowledge).
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks