MySQL Pager class





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

« Previous 1 2  ...  8 9 10 11 12 13 14 15 16 Next »
9
Date Submitted Sun. Apr. 29th, 2007 4:42 PM
Revision 1
Helper Nico
Tags API | Class | message | PHP | Send | SMS
Comments 5 comments
This PHP class allows you to send SMS to almost every country directly from your website. All you need is an account on www.tm4b.com and PHP 5.

Also required is either cURL or allow_url_fopen enabled in php.ini
0
Date Submitted Wed. Nov. 12th, 2008 9:57 AM
Revision 1
Beginner nostromo
Tags mysql
Comments 0 comments
Cuando concatenamos varios campos con CONCAT( Campo1, Campo2,... ) si algún valor es NULL no se realiza la concatenación, para concater campos (aunque algunos tengan NULL) usaremos COALESCE que devuelve el primer valor que no sea null de la lista.
Asi le pasaremos una listca con el nombre del campo seguido de "", si el campo estava lleno, devuelve el campo, si es null devuelve el segundo, es decir ""
11
Date Submitted Mon. Sep. 18th, 2006 5:02 AM
Revision 1
Helper nothingless
Tags forcodegrrl | forms | PHP
Comments 0 comments
The below code will generate a form dropdown for all 12 months, with the current month selected. Handy for those date pickers!
10
Date Submitted Mon. Sep. 18th, 2006 5:05 AM
Revision 1
Helper nothingless
Tags forcodegrrl | forms | PHP
Comments 0 comments
The below code will generate a form dropdown for all the days of the month, with today's day selected. Handy for those date pickers!
13
Date Submitted Mon. Sep. 18th, 2006 5:13 AM
Revision 1
Helper nothingless
Tags forcodegrrl | PHP
Comments 3 comments
For those times you need to do a loop in PHP, but have the outcome be in descending order (ie, start at 10 and end at 1).
9
Date Submitted Sun. Nov. 19th, 2006 12:30 PM
Revision 1
Beginner pcolella
Tags PHP
Comments 2 comments
This is a rewrite of a basic ADODB / PHP Database pager. This pager has some very slick search, sort, and display configuration options. Modifications and improvements are very welcome. Thus I am sharing this code.

A basic example for using this pager would be as follows:

// Check class code for CSS styles used
require_once ('class.init.php');

// SQL Statement
$sql = 'SELECT table1.field1, table1.field2, table1.field3 FROM table1';

// Field Labels
$label_arr = array (
'field1' => 'Field 1 Heading',
'field2' => 'Field 2 Heading',
'field3' => 'Field 3 Heading'
);

// Hidden Fields
$vsel_arr = array (
'field3' => 0 // don't display field3 unless requested by the user
);

$sort_arr = array (
'field1' => 'asc' // sort by field1 ascending order (asc) or (desc)
);

// Config array
$config = array (
'db' => &$dbconn, // open ADODB connection
'sql' => $sql, // String of sql
'id' => 'table1_pager', // pager id for session variables
'label_arr' => $label_arr, // field heading array
'vsel_arr' => $vsel_arr, // fields to hide
'extra_param' => '', // extra paramaters to pass with edit, delete, add anchors
'form_width' => '100%', // table with
'form_title' => 'Table 1', // table title
'edit_anchor' => 'Edit', // link to edit
'del_anchor' => 'Del', // link to delete
'add_anchor' => 'Add', // link to add
'print_anchor' => 'Print', // link to print
'header_view' => true, // no function at this time
'search_view' => true, // no function at this time
'pk' => array ('field1' => true), // primary key field
'sort_arr' => $sort_arr, // sort field array
);

// create object then render it ...
$_pager = new pager($config); // create instance
echo $_pager->render(25); // render output
11
Date Submitted Wed. Jul. 5th, 2006 8:15 AM
Revision 2
Helper poncho
Tags Array | Name | PHP | String | Value
Comments 3 comments
Convert an irregular name=value pair string into a formatted array.
21
Date Submitted Fri. Nov. 11th, 2005 2:51 PM
Revision 1
Beginner Possibility
Tags Paragraph | PHP | String
Comments 0 comments
Proper Paragraphs
17
Date Submitted Thu. Jul. 27th, 2006 4:51 AM
Revision 1
Helper rastersize
Tags PHP | quotes
Comments 1 comments
The recursive function stripslashesDeep($value) will (upon called) strip slashes (\) from strings and arrays (even arrays with arrays within themself). The controlstatement (if) checks if magic quotes gpc is on, if it is we strip the slashes it have added.

Very good snippet if you want to have the "same" input even if you switch to an enviroment where magic quotes gpc is set to something else than on your originall server.
18
Date Submitted Thu. Jul. 27th, 2006 4:56 AM
Revision 1
Helper rastersize
Tags "register | globals" | PHP
Comments 0 comments
This snippet will undo all the nasty stuff which happens when you set register_globals to on in your php.ini file.

(Originally found in the code of Wordpress).
« Previous 1 2  ...  8 9 10 11 12 13 14 15 16 Next »