Forum Moderators: coopster

Message Too Old, No Replies

Sortable Tables?

         

Rynman47

4:17 am on May 27, 2008 (gmt 0)

10+ Year Member



Hi guys

I had two questions.

I have no knowledge of PHP and am wondering if it the language I need to learn in order to achieve my goal.

I'd like a page that has a data table that is sortable, and that can have rows removed, and totals calculated accordingly. Is PHP the way to do this?

In addition to this, can I use PHP to query another page that contains data, format it, and set it out how I want in a table on the page (and then sort it etc)?

Thanks! Any info at this point would be awesome. :)

cameraman

6:29 am on May 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll probably wind up wanting to learn both php and javascript. The good news is that they're similar in syntax so once you learn one the other is easier to learn. I suggest php first because javascript is a lot more involved with the structure of the document - more terminology to learn.

PHP is a server-side language, while javascript is a browser-side language. What that means is that everything you do in php is done before the content gets sent to the browser. You use javascript to manipulate the content once it's reached the browser.

If your table data comes from a database, you'll need php or another server-side language in order to retrieve it. I'm inferring that by 'table that is sortable' you want the visitor to be able to do the manipulations. While you could use php to respond to those manipulations, it means reloading the page - the visitor sends the request to re-sort to the server and a php script sends the data back to the browser in the new order.

If you use javascript to manipulate the data that's already there at the visitor's browser, it can happen much faster since nothing gets retransmitted.

Either language can be used to query another page - which you use depends on where that page is located (whether at your web site or another) and how you want it integrated into the visitor's current page.

Rynman47

11:45 pm on May 27, 2008 (gmt 0)

10+ Year Member



Thanks cameraman - that's great! Any particular sites that you know of that have good tutorials? :)

cameraman

12:26 am on May 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[w3schools.com ] is probably a good starting point - I didn't learn either language from there, but from the stuff I have learned there it seems pretty well written. I finally learned the most javascript from gritting my teeth and getting the Javascript Bible.

jatar_k

1:22 am on May 28, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try this thread from our library [webmasterworld.com]

Learning PHP - Books, Tutorials and Online Resources [webmasterworld.com]

Rynman47

1:55 am on May 28, 2008 (gmt 0)

10+ Year Member



:D
That's awesome. I love this place!