| the ezSQL query produces this ezsql_disk_cache_object on the first db query |
display below comes from processing the cached object |
script reads cache and generates results array based on user clicks |
||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
cached object
Array ( [0] => stdClass Object ( [id] => 164 [fname] => Dr Richard [lname] => Alexander [email] => [address] => North Shore Physicians Group 331 Highland Avenue Salem, MA 01970 [ph_home] => [ph_work] => (978) 745-1200 [ph_cell] => [fax] => [notes] => [url] => [username] => [password] => [dateentered] => 2011-03-18 07:10:30 [category] => Alien [fletter] => A ) [1] => stdClass Object ( [id] => 169 [fname] => Gregory [lname] => Andre, DDS [email] => [address] => Silver Lake Dental 96 Main St. Wilmington, MA 1887 [ph_home] => [ph_work] => (978) 658-8400 [ph_cell] => [fax] => [notes] => [url] => [username] => [password] => [dateentered] => 2012-01-06 14:19:24 [category] => Alien [fletter] => A ) [2] => stdClass Object ( [id] => 48 [fname] => Joe and Kathy [lname] => Archambault [email] => [address] => 53 Thorndike St Beverly, MA 01915 149 Federal Street Salem, MA 01970 [ph_home] => Bev 978-927-0848 [ph_work] => [ph_cell] => [fax] => [notes] => [url] => [username] => [password] => [dateentered] => 2011-01-17 10:00:34 [category] => Politician [fletter] => A ) [3] => stdClass Object ( [id] => 148 [fname] => Joe Jr [lname] => Archambault [email] => P71SOHC@aol.com [address] => 36 Dunham Road Beverly, MA 01915 [ph_home] => [ph_work] => [ph_cell] => 978-979-7762 [fax] => [notes] => Work: Manchester By-the-Sea PD Age: 25 (July, 2008) Fiance: Megan [url] => [username] => [password] => [dateentered] => 2008-08-08 05:22:59 [category] => Alien [fletter] => A ) [4] => stdClass Object ( [id] => 168 [fname] => [lname] => Backyard Boats [email] => [address] => 4819 Woods Wharf Road Shady Side, MD 20764 [ph_home] => [ph_work] => 410-867-4800 [ph_cell] => [fax] => [notes] => Susan S2 7.9 Brandon [url] => [username] => [password] => [dateentered] => 2012-01-04 10:57:29 [category] => Alien [fletter] => B ) [5] => stdClass Object ( [id] => 171 [fname] => [lname] => Boulter Plywood [email] => [address] => 24 Broadway, Somerville, MA 02145-3394 [ph_home] => [ph_work] => 617-666-1340 [ph_cell] => [fax] => [notes] => Rt 107 follow for 8.9 mi R onto Rt 60 - go 1.5 mi L onto Rt 99 - go 2.3 mi R onto Rte 38 - go .3 mi L at Lombardi St go 400 ft L onto Broadway go 400 ft [url] => [username] => [password] => [dateentered] => 2012-01-10 08:21:42 [category] => Alien [fletter] => B ) [6] => stdClass Object ( [id] => 165 [fname] => Frank & Gertrude [lname] => Byrne [email] => [address] => 620 So. West Street Feeding Hills, MA 01030 [ph_home] => [ph_work] => [ph_cell] => [fax] => [notes] => Sent Swivel Cushion 3/26 $12.48 + $2.00 = $14.48 DreamProductsCatalog.com 1-800-528-0197 Conf# 1835785 [url] => [username] => [password] => [dateentered] => 2011-03-26 12:56:57 [category] => Alien [fletter] => B ) [7] => stdClass Object ( [id] => 153 [fname] => Ronald [lname] => Cimon [email] => [address] => 52 Flint Street Salem, MA 01970 [ph_home] => [ph_work] => [ph_cell] => 978-809-7846 [fax] => [notes] => [url] => [username] => [password] => [dateentered] => 2008-12-05 06:20:03 [category] => Alien [fletter] => C ) [8] => stdClass Object ( [id] => 146 [fname] => Henry [lname] => Clark [email] => teecharley@onetel.com [address] => h. clark, tycharlie, 3,bridge villas, narberth, pembrokeshire, sa67 8rb [ph_home] => [ph_work] => [ph_cell] => [fax] => [notes] => Bought Twiggy Mk2 plan set Paid $ 850 (rcvd 816 after Paypal fees) plus $64 for postage. Received satifactorily and happy withthe plans. [url] => [username] => [password] => [dateentered] => 2007-10-16 13:40:50 [category] => Alien [fletter] => C ) [9] => stdClass Object ( [id] => 46 [fname] => Duane [lname] => Cobb [email] => duane@marathonmarine.com [address] => 800 35th St Ocean Marathon, FL 33050 s/v Trilogy [ph_home] => [ph_work] => [ph_cell] => 305-393-2178 [fax] => [notes] => s/v Trilogy Newburyport mooring and Y.C. [url] => http:// [username] => [password] => [dateentered] => 2006-04-18 08:04:14 [category] => Politician [fletter] => C ) ) |
TBS results from "mycontacts" table
Here's a code snippet to show how easy it is to do this stuff <?php //the PHP code to get the 'category' subset from cache object // Lets get the subset based on the returned $_GET parm if( isset($cat) ) { unset($recs); // remember to clear previous vals foreach ($result as $item){ // $result is original the cache object // just items that match this 'cat' if( $item->category==$cat ){ // to get ALL fields from the cache object $recs[] = $item; // To get just SOME specific fields only -build array manually // for TBS to use in the block merge -like this //$recs[] = array("id"=>"$item->id", "fname"=>"$item->fname"); } } } $TBS->MergeBlock('blk', $recs); ?> TBS object syntax examples: 'var.result.0.category' = Alien 'var.result.1.category' = Alien 'var.result.2.category' = Politician 'var.result.0.lname' = Alexander 'var.result.1.lname' = Andre, DDS 'var.result.2.lname' = Archambault |
_GET=
Array ( [0] => stdClass Object ( [id] => 164 [fname] => Dr Richard [lname] => Alexander [email] => [address] => North Shore Physicians Group 331 Highland Avenue Salem, MA 01970 [ph_home] => [ph_work] => (978) 745-1200 [ph_cell] => [fax] => [notes] => [url] => [username] => [password] => [dateentered] => 2011-03-18 07:10:30 [category] => Alien [fletter] => A ) [1] => stdClass Object ( [id] => 169 [fname] => Gregory [lname] => Andre, DDS [email] => [address] => Silver Lake Dental 96 Main St. Wilmington, MA 1887 [ph_home] => [ph_work] => (978) 658-8400 [ph_cell] => [fax] => [notes] => [url] => [username] => [password] => [dateentered] => 2012-01-06 14:19:24 [category] => Alien [fletter] => A ) [2] => stdClass Object ( [id] => 48 [fname] => Joe and Kathy [lname] => Archambault [email] => [address] => 53 Thorndike St Beverly, MA 01915 149 Federal Street Salem, MA 01970 [ph_home] => Bev 978-927-0848 [ph_work] => [ph_cell] => [fax] => [notes] => [url] => [username] => [password] => [dateentered] => 2011-01-17 10:00:34 [category] => Politician [fletter] => A ) [3] => stdClass Object ( [id] => 148 [fname] => Joe Jr [lname] => Archambault [email] => P71SOHC@aol.com [address] => 36 Dunham Road Beverly, MA 01915 [ph_home] => [ph_work] => [ph_cell] => 978-979-7762 [fax] => [notes] => Work: Manchester By-the-Sea PD Age: 25 (July, 2008) Fiance: Megan [url] => [username] => [password] => [dateentered] => 2008-08-08 05:22:59 [category] => Alien [fletter] => A ) [4] => stdClass Object ( [id] => 168 [fname] => [lname] => Backyard Boats [email] => [address] => 4819 Woods Wharf Road Shady Side, MD 20764 [ph_home] => [ph_work] => 410-867-4800 [ph_cell] => [fax] => [notes] => Susan S2 7.9 Brandon [url] => [username] => [password] => [dateentered] => 2012-01-04 10:57:29 [category] => Alien [fletter] => B ) [5] => stdClass Object ( [id] => 171 [fname] => [lname] => Boulter Plywood [email] => [address] => 24 Broadway, Somerville, MA 02145-3394 [ph_home] => [ph_work] => 617-666-1340 [ph_cell] => [fax] => [notes] => Rt 107 follow for 8.9 mi R onto Rt 60 - go 1.5 mi L onto Rt 99 - go 2.3 mi R onto Rte 38 - go .3 mi L at Lombardi St go 400 ft L onto Broadway go 400 ft [url] => [username] => [password] => [dateentered] => 2012-01-10 08:21:42 [category] => Alien [fletter] => B ) [6] => stdClass Object ( [id] => 165 [fname] => Frank & Gertrude [lname] => Byrne [email] => [address] => 620 So. West Street Feeding Hills, MA 01030 [ph_home] => [ph_work] => [ph_cell] => [fax] => [notes] => Sent Swivel Cushion 3/26 $12.48 + $2.00 = $14.48 DreamProductsCatalog.com 1-800-528-0197 Conf# 1835785 [url] => [username] => [password] => [dateentered] => 2011-03-26 12:56:57 [category] => Alien [fletter] => B ) [7] => stdClass Object ( [id] => 153 [fname] => Ronald [lname] => Cimon [email] => [address] => 52 Flint Street Salem, MA 01970 [ph_home] => [ph_work] => [ph_cell] => 978-809-7846 [fax] => [notes] => [url] => [username] => [password] => [dateentered] => 2008-12-05 06:20:03 [category] => Alien [fletter] => C ) [8] => stdClass Object ( [id] => 146 [fname] => Henry [lname] => Clark [email] => teecharley@onetel.com [address] => h. clark, tycharlie, 3,bridge villas, narberth, pembrokeshire, sa67 8rb [ph_home] => [ph_work] => [ph_cell] => [fax] => [notes] => Bought Twiggy Mk2 plan set Paid $ 850 (rcvd 816 after Paypal fees) plus $64 for postage. Received satifactorily and happy withthe plans. [url] => [username] => [password] => [dateentered] => 2007-10-16 13:40:50 [category] => Alien [fletter] => C ) [9] => stdClass Object ( [id] => 46 [fname] => Duane [lname] => Cobb [email] => duane@marathonmarine.com [address] => 800 35th St Ocean Marathon, FL 33050 s/v Trilogy [ph_home] => [ph_work] => [ph_cell] => 305-393-2178 [fax] => [notes] => s/v Trilogy Newburyport mooring and Y.C. [url] => http:// [username] => [password] => [dateentered] => 2006-04-18 08:04:14 [category] => Politician [fletter] => C ) ) Array ( [Alien] => Alien [Politician] => Politician ) Array ( [A] => A [B] => B [C] => C ) |