MySQL Pager class





ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

« Previous 1 2 3 4 5 6 7 8 9  ...  14 15 Next »
7
Date Submitted Thu. Mar. 1st, 2007 3:53 PM
Revision 1
Helper mjlintz
Tags PHP
Comments 0 comments
Generate multi select box from data in db, then when submitted, each selection is written to a db table as it's own record, each tied together by a common record id.
-6
Date Submitted Thu. Mar. 1st, 2007 3:56 PM
Revision 1
Helper mjlintz
Tags PHP
Comments 5 comments
Get the count of records from DB
12
Date Submitted Thu. Mar. 1st, 2007 4:01 PM
Revision 1
Helper mjlintz
Tags PHP
Comments 3 comments
With this function you can calculate the age of a person

Example:
echo "Age is: " . age("1984-07-05");

Result will be (23 Feb 2005) = "Age is: 20"
7
Date Submitted Mon. Nov. 28th, 2005 4:35 PM
Revision 1
Beginner Michael
Tags Extract | PHP
Comments 3 comments
Using the extract() Functio
-7
Date Submitted Fri. Feb. 17th, 2006 4:52 AM
Revision 3
Helper mercutio
Tags mysql
Comments 0 comments
I use this method for keeping my sql templates away from my code.

You can extend upon the idea, as I have done in the past, by placing SQL handing classes between your scripts and the template library.

Things to note here:

The lesser userd heredoc string method. The reason this is used is to keep the SQL clear and well laid out, and not as messy as using quotes.

vsprintf() is a very handy function if you don't want to hard code the number of parameters to interpolate your string with.

The use of sprintf templates offers you additional security. For example, only allowing numbers to be placed where a %d falls. This, of course, shouldn't be the only security on user supplied variables, but comes in extra handy for debugging purposes.

Regarding the TODO in there, it would take a check of the number of % placeholders there are in the template. One caveat is remembering to remove the count of %%'s that appear (the literal percentage).
15
Date Submitted Sun. Aug. 27th, 2006 10:44 AM
Revision 1
Helper mceppi
Tags filesize | PHP
Comments 2 comments
A small recursive php function to determine the size of a directory by adding all it's contents together and returning them as an integer.
8
Date Submitted Sun. Oct. 9th, 2005 8:32 PM
Revision 1
Coder mattrmiller
Tags PHP | String | Truncate
Comments 1 comments
Truncate String
14
Date Submitted Mon. Oct. 10th, 2005 10:18 AM
Revision 1
Coder mattrmiller
Tags Extension | File | PHP
Comments 1 comments
Get File Extensio
9
Date Submitted Mon. Oct. 10th, 2005 10:25 AM
Revision 1
Coder mattrmiller
Tags File | PHP | Size
Comments 3 comments
Get File Size
8
Date Submitted Sun. Feb. 19th, 2006 2:27 PM
Revision 2
Coder mattrmiller
Tags PHP | Referrer | Validate
Comments 6 comments
Fixed missing $ sign.
« Previous 1 2 3 4 5 6 7 8 9  ...  14 15 Next »