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

« Previous 1 2 3 Next »
12
Date Submitted Thu. Oct. 12th, 2006 3:32 PM
Revision 1
Beginner ammonkc
Tags mysql | Pager | PHP
Comments 2 comments
This is a mysql php pager class that I found online somewhere and modified.
13
Date Submitted Sat. Oct. 21st, 2006 9:21 AM
Revision 1
Beginner hax
Tags mysql | PHP | phps
Comments 1 comments
Pagination Class , I think everyone knew now what's it does and means

NT: This class written by my friend have phun!
14
Date Submitted Mon. Jan. 15th, 2007 5:30 PM
Revision 1
Helper Idlemind
Tags Authentication | mysql | PHP | Security
Comments 8 comments
MySQL 5.x Stored Routines, PHP Session Values, a little CSS oh my! Complex to set up but easy to impliment. Geared toward security, simplicity (of use) and convenience.
21
Date Submitted Tue. Oct. 24th, 2006 8:13 PM
Revision 1
Helper dohpaz
Tags mysql | mysqli | PHP
Comments 4 comments
If you've ever wanted to build an application that can both find the distance between two zip codes, and find zip codes within a specific radius of another zip code, then this is the snippet for you.

I've tried to build this before using PHP4 and MySQL 4 and have found it to be painfully slow for a one-user connection over a Local Area Network (LAN). So, before you continue reading, I must make it abundantly clear that this method requires PHP 5 and MySQL 5.

This is because in PHP5, we will need the MySQL-Improved interfaces, and in MySQL 5, we will need functions and procedures.

Using functions and procedures in MySQL puts the weight of the calculations on MySQL, where they will run hundreds of times faster than if PHP were to attempt to do the work. In addition, using functions and procedures is still hundreds of times faster than carefully crafted SQL statements (one benchmark took over 10 seconds using a WHERE clause, while the function + procedure method took around .12 seconds--note the dot).

Since I am not a mathematician by trade, I found the necessary calculations using Google.

For the "Great Circle Distance" formula, I used Meridian Word Data's website. For the radius finder, I used another that unfortunately I do not have off the top of my head right now. I will look for it again and repost it for proper accreditation.

For the zip code database, I am using the free zip code database from CFDynamics.

Below, you will find the database and table schema, the functions and procedures, and also a demo PHP script to see all of this put into action. As a courtesy, you may download a dump of this database from my website. It's uncompressed size is 3.4M, and it's compressed size is 537K. The checksum is available here.

Please leave me comments, suggestions, questions, and/or rants about this snippet. I feel this is a very useful bit of code, and hope that others out there may find as much use from it as I will be.
23
Date Submitted Thu. Oct. 5th, 2006 11:49 AM
Revision 1
Helper Idlemind
Tags mysql | PHP
Comments 1 comments
"Today in the news, MySQL previews..."

As a "preview" of text, this MySQL select will return the first few words out of a text field in a database. It returns entire words (doesn't cut them off in the middle) and follows the last word with an elipse "..."

In the PHP, assign $CharactersToDisplay to a number - the approximate number of characters desired (or you can hard-code it if you want).

For the example, I also use $TheID as the row identity for the record to display.
« Previous 1 2 3 Next »