Below are snippets for Idlemind.

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

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.
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.
11
Date Submitted Thu. Oct. 5th, 2006 12:01 PM
Revision 1
Helper Idlemind
Tags ajax | JavaScript
Comments 4 comments
I use this in my AJAX as a quick way to get the Value of the selected item in a Select HTML object. If nothing is selected, it returns zero.
(May be basic to y'all, but maybe really usefull to someone else).
3
Date Submitted Wed. Nov. 7th, 2007 2:45 PM
Revision 1
Helper Idlemind
Tags PHP
Comments 1 comments
If it's a .php page, you can simply include this file where you want a hit counter to appear.

One file - text output. Very simple, very easy. Based off the filename of the page (creates a pagename.counter file to hold the count).
(No use for it myself - made it for a friend).
2
Date Submitted Wed. Feb. 28th, 2007 1:11 PM
Revision 1
Helper Idlemind
Tags MSSQL | mysql
Comments 0 comments
When you need to perform an action on a single row of data, many people turn to cursors. Cursors come with a lot of overhead in the database engine and can be confusing. Here's a way to get the same results without the overhead in a much simplier way.