Entries tagged "database"

Sorting HTML Data Tables Part 2: Dynamically Sort in Ascending and Descending Order

In last week's post we looked at dynamically sorting HTML data tables. But we only talked about sorting the columns in either ascending or descending. If the user is looking for a last name that appears near the end of the alphabet and the column is sorted from A to Z, they may have a lot of names to go through before finding the one they want. Instead we could provide an option for sorting in both descending and ascending order. [Continue reading]

Sorting HTML Data Tables Using the Header Row with PHP

When displaying a data tables, how do you usually sort the information? Do you sort by the field that you think is the most important to the visitor? For example, it's perfectly acceptable to show a list of order by date; showing the newest order first. But what if the user wants the data organized differently? We could let them choose the column to sort by. [Continue reading]

Changing Database Entries on the Fly by Embedding PHP Variables

When pulling information from a database, have you ever needed to change aspects of the text on the fly. For example, let's say you have a form which is populated from a database with questions like "Did you utilize any of the website resources in 2011?" If the form is submitted annually, the 2011 needs to correspond with the year the form is being filled out by visitors. You could remove the year, but what if the question becomes too vague without it. In a perfect world, we could store a PHP variable in the database along with the question, but we can't do that…can we? [Continue reading]