<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>Eternally Curious</title><description>A blog about my curiosity in technology, hobbies, life and everything else in the universe.</description><managingEditor>noreply@blogger.com (Hector Perez)</managingEditor><pubDate>Wed, 11 Sep 2024 21:10:29 -0400</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">9</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://eternallycuriousblog.blogspot.com/</link><language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:subtitle>A blog about my curiosity in technology, hobbies, life and everything else in the universe.</itunes:subtitle><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><item><title>Flexigrid examples using xml</title><link>http://eternallycuriousblog.blogspot.com/2011/10/flexigrid-examples-using-xml.html</link><category>examples highlight</category><category>flexigrid</category><category>onclick</category><category>xml</category><author>noreply@blogger.com (Hector Perez)</author><pubDate>Thu, 20 Oct 2011 19:37:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1538939303590269982.post-3973402238421432095</guid><description>&lt;blockquote&gt;&lt;/blockquote&gt;Lately I have been using the &lt;a href="http://jqueryui.com/"&gt;jquery ui &lt;/a&gt;to improve the look and style on the web site I am developing for a company. But as good as &lt;a href="http://jqueryui.com/"&gt;jquery ui&lt;/a&gt; is what messing a big piece, grids!&lt;br /&gt;&lt;p&gt;So I looked for a solution that would create good looking grids with the minimun of fuzz. I found it in &lt;a href="http://flexigrid.info/"&gt;http://flexigrid.info/&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;It is a &lt;a href="http://jqueryui.com/"&gt;jquery ui&lt;/a&gt; extension that adds easy to create grids to a web site. The only draw back it is not well documented, especially if using xml data instead of the json data. I advice that you start by reading and seeing the examples on the &lt;a href="http://flexigrid.info/"&gt;http://flexigrid.info/&lt;/a&gt; site so you can get started. But soon you  will need to see some examples, especially with xml. These XML examples helpful to figure out how to use flexigrid  with xml data.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:180%;"&gt;&lt;a href="http://haperez.com/examples/flexygrid_examples.zip"&gt;First here is the link to a zip file&lt;/a&gt; with the source code for the examples.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The first example uses a static xml file. It just creates a grid on a page. Notice that I placed the grid inside a div container. This is the best method to size the height and width of the grid. Also note that I did not specified the width, so the grid will expand to all available width on the division. The height of the grid I control with javacode &lt;code&gt; $("#GridArea").innerHeight()*.80 &lt;/code&gt;. This makes the grid 80% of the container leaving space for the navigation bar. You can also choose just to subtract a specific number of pixels instead.&lt;br /&gt;&lt;/p&gt;&lt;a href="http://haperez.com/examples/flexigrid1.php"&gt;Here is this example page on my website&lt;/a&gt; and here is the code:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-family:Georgia,serif;"&gt;&lt;p&gt;&amp;lt;!DOCTYPE HTML&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;title&amp;gt;Flexigrid Example 1&amp;lt;/title&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;link href="/CSS/flexigrid.css" rel="stylesheet" type="text/css" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css" /&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="/js/flexigrid.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;script type="text/javascript" &amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;$(function() {&lt;br /&gt;&lt;br /&gt;$("#flex1").flexigrid({&lt;br /&gt;url: 'zipcode_small.xml',&lt;br /&gt;dataType: 'xml',&lt;br /&gt;colModel : [&lt;br /&gt;{display: 'City', name : 'City', width : 150, align: 'left'},&lt;br /&gt;{display: 'State', name : 'StateName', width : 150,  align: 'left'},&lt;br /&gt;{display: 'Abbreviation', name : 'StateAbb', width : 40, align: 'left'},&lt;br /&gt;{display: 'Zip', name : 'Zip', width : 50, align: 'left'},&lt;br /&gt;{display: 'Latitude', name : 'Latitude', width : 100, align: 'left'},&lt;br /&gt;{display: 'Longitude', name : 'Longitude', width : 100, align: 'left'},&lt;br /&gt;{display: 'Timezone', name : 'Timezone', width : 100, align: 'left'},&lt;br /&gt;{display: 'DST', name : 'DST', width : 50, align: 'left'}&lt;br /&gt;],&lt;br /&gt;rp: 20,&lt;br /&gt;usepager: true,&lt;br /&gt;title: "Zip code list",&lt;br /&gt;useRp: true,&lt;br /&gt;showTableToggleBtn: false,&lt;br /&gt;resizable: true,&lt;br /&gt;height: $("#GridArea").innerHeight()*.80,&lt;br /&gt;singleSelect: true&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;});&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;div id="content" style="width:600px; height:400px"&amp;gt;&lt;br /&gt;The flexigrid display a static xml file. added  height: $("#GridArea").innerHeight()*.80   , to make the grid 80% og the height of the countainer to give espace for the page bar. You can also use  height: $("#GridArea").innerHeight()-45, to do the same thing (substractiong 45 pixels to give it space).&lt;br /&gt;&amp;lt;div id="GridArea" style="width:100%; height:100%"&amp;gt;&lt;br /&gt;&amp;lt;table id="flex1"&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;/span&gt;&lt;/code&gt;The grid open the &lt;code&gt;zipcode_small.xml&lt;/code&gt; page with the data. The xml is has to be formatted in a very specific way.&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Example:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&amp;lt;rows&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&amp;lt;page&amp;gt;x&amp;lt;/page&amp;gt;&lt;br /&gt;&amp;lt;total&amp;gt;xx&amp;lt;/total&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&amp;lt;row id="1"&amp;gt;&amp;lt;cell&amp;gt;&amp;lt;/cell&amp;gt;&amp;lt;cell&amp;gt;&amp;lt;/cell&amp;gt;&amp;lt;/row&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&amp;lt;row id="2"&amp;gt;&amp;lt;cell&amp;gt;&amp;lt;/cell&amp;gt;&amp;lt;cell&amp;gt;&amp;lt;/cell&amp;gt;&amp;lt;/row&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&amp;lt;/rows&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The &amp;lt;page&amp;gt; is the page of the record set the &amp;lt;total&amp;gt; is the number of records, then each row for the table with each cell of data for the table.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://haperez.com/examples/flexigrid2.php"&gt;Here is this example page 2 on my website&lt;/a&gt;&lt;br /&gt;&lt;a href="http://haperez.com/examples/flexigrid3.php"&gt;Here is this example page 3 on my website&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://http//haperez.com/examples/flexigrid4.php"&gt;On example page 4&lt;/a&gt;  flexigrid4.php has two functions, have one that fires when a cell is clicked and another changes the color of the cell according to value (if the state is Florida or Georgia).&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&amp;lt;!DOCTYPE HTML&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Flexigrid Example 4&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css" /&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="/js/flexigrid.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;link href="/CSS/flexigrid.css" rel="stylesheet" type="text/css" /&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript" &amp;gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;$(function() {&lt;br /&gt;&lt;br /&gt;$("#flex1").flexigrid({&lt;br /&gt;url: 'vwzip.php',&lt;br /&gt;dataType: 'xml',&lt;br /&gt;colModel : [&lt;br /&gt;{display: 'City', name : 'City', width : 150, sortable : true, align: 'left',process: procMe},&lt;br /&gt;{display: 'State', name : 'StateName', width : 150, sortable : true, align: 'left',process: procMe},&lt;br /&gt;{display: 'Abbreviation', name : 'StateAbb', width : 40, sortable : true, align: 'left',process: procMe},&lt;br /&gt;{display: 'Zip', name : 'Zip', width : 50, sortable : true, align: 'left',process: procMe},&lt;br /&gt;{display: 'Latitude', name : 'Latitude', width : 100, sortable : true, align: 'left',process: procMe},&lt;br /&gt;{display: 'Longitude', name : 'Longitude', width : 100, sortable : true, align: 'left',process: procMe},&lt;br /&gt;{display: 'Timezone', name : 'Timezone', width : 100, sortable : true, align: 'left',process: procMe},&lt;br /&gt;{display: 'DST', name : 'DST', width : 50, sortable : true, align: 'left',process: procMe}&lt;br /&gt;],&lt;br /&gt;searchitems : [&lt;br /&gt;{display: 'City', name : 'City'},&lt;br /&gt;{display: 'State', name : 'StateName'},&lt;br /&gt;{display: 'Zip', name : 'Zip', isdefault: true}&lt;br /&gt;],&lt;br /&gt;rp: 20,&lt;br /&gt;sortname: "City",&lt;br /&gt;sortorder: "asc",&lt;br /&gt;usepager: true,&lt;br /&gt;title: "Zip code list",&lt;br /&gt;useRp: true,&lt;br /&gt;showTableToggleBtn: false,&lt;br /&gt;resizable: true,&lt;br /&gt;height: $("#GridArea").innerHeight()*.80,&lt;br /&gt;singleSelect: true,&lt;br /&gt;onSuccess: function(){highlight()}&lt;br /&gt;});&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;function procMe(celDiv,id) {&lt;br /&gt;$(celDiv).click(&lt;br /&gt;function () {&lt;br /&gt;alert('Row ID:'+(id)+' with cell value of '+celDiv.innerHTML);&lt;br /&gt;}&lt;br /&gt;);&lt;br /&gt;}; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;function highlight() {&lt;br /&gt;var i=0;&lt;br /&gt;for (i=0;i &amp;lt; document.getElementById("flex1").rows.length;i++)&lt;br /&gt;{&lt;br /&gt;var table=document.getElementById("flex1");&lt;br /&gt;// cell numbers start with 0  since the state is the second column the cell number is 1&lt;br /&gt;var State_To_Check=table.rows[i].cells[1].firstChild.innerHTML;&lt;br /&gt;if (State_To_Check=="FLORIDA") {&lt;br /&gt;table.rows[i].cells[1].firstChild.style.backgroundColor="#FF0";&lt;br /&gt;}&lt;br /&gt;if (State_To_Check=="GEORGIA") {&lt;br /&gt;table.rows[i].cells[1].firstChild.style.backgroundColor="#00FF00";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;div id="content" style="width:600px; height:400px"&amp;gt;&lt;br /&gt;&amp;lt;div id="GridArea" style="width:100%; height:100%"&amp;gt;&lt;br /&gt;&amp;lt;table id="flex1"&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;The code for the xml generating page is important. You must pass the following post variables for the &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt; navegation bar to be usefull: &lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;rp,&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;page, &lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;sortorder,sortname,&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;query,&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt; qtype&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;The variable are use for the following functions:&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;the &lt;span style="font-style: italic;"&gt;rp &lt;/span&gt;sets the number of records per page&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;page &lt;/span&gt;is what page you are on.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;sortorder &lt;/span&gt;= the order of field (asc for ascending, desc for descending)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;sortname&lt;/span&gt;= the field to sort&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;query&lt;/span&gt;= the value to each for&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;qtype= &lt;/span&gt;the column to search for&lt;/span&gt;&lt;/p&gt;&lt;p&gt;in the example bellow you can see how these post variable work to select and order the xml data.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;?php require_once('../Connections/ExampleDB.php'); ?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?PHP&lt;br /&gt;//page number of the  grid&lt;br /&gt;$pageNum_Recordset1 = 1;&lt;br /&gt;if (isset($_POST['page'])) {&lt;br /&gt;$pageNum_Recordset1 = mysql_real_escape_string($_POST['page']);&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;// sort order of the grid&lt;br /&gt;&lt;br /&gt;$Recordset1_Order="";&lt;br /&gt;if (isset($_POST['sortorder']) and isset($_POST['sortname'])) {&lt;br /&gt;$SortBy_Recordset1= mysql_real_escape_string($_POST['sortname']);&lt;br /&gt;$SortDirectionRecordset1 = mysql_real_escape_string($_POST['sortorder']);&lt;br /&gt;$Recordset1_Order="Order by ".$SortBy_Recordset1." ".$SortDirectionRecordset1;&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;// passing the search values from the search box&lt;br /&gt;$Search_column="";&lt;br /&gt;$Search_value="";&lt;br /&gt;$query_Recordset1_Where="";&lt;br /&gt;if (isset($_POST['query']) and isset($_POST['qtype'])) {&lt;br /&gt;$Search_column = trim(mysql_real_escape_string($_POST['qtype']));&lt;br /&gt;$Search_value = trim(mysql_real_escape_string($_POST['query']));&lt;br /&gt;$query_Recordset1_Where=" Where ".$Search_column." like '".$Search_value. "%' ";&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;// number of records on the grid&lt;br /&gt;&lt;br /&gt;$maxRows_Recordset1 = 20;&lt;br /&gt;if (isset($_POST['rp'])) {&lt;br /&gt;$maxRows_Recordset1 = mysql_real_escape_string($_POST['rp']);&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;// idField is the firld name to use for row id key and for the cound of records&lt;br /&gt;&lt;br /&gt;$idField = "Zip";&lt;br /&gt;// basic query statements&lt;br /&gt;$query_Statement_Recordset1 = "SELECT City,StateName,StateAbb,Zip,Latitude,Longitude,Timezone,DST FROM vwzip ";&lt;br /&gt;$query_Count_Statement_Recordset1 = "SELECT COUNT(Zip)  FROM vwzip ";&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;// start row is the page times the number of records per page&lt;br /&gt;&lt;br /&gt;$startRow_Recordset1=0;&lt;br /&gt;$startRow_Recordset1 = ($pageNum_Recordset1-1) * $maxRows_Recordset1;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;// add filter (search) criteria&lt;br /&gt;$query_Recordset1 = $query_Statement_Recordset1.$query_Recordset1_Where.$Recordset1_Order;&lt;br /&gt;&lt;br /&gt;$query_Count_Recordset1 = $query_Count_Statement_Recordset1.$query_Recordset1_Where; &lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt; // limit to the page amount of records&lt;br /&gt;$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;//open connection&lt;br /&gt;mysql_select_db($database_ExampleDB, $ExampleDB);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;// recordset with count&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;$all_Recordset1 = mysql_query($query_Count_Recordset1, $ExampleDB) or die(mysql_error());&lt;br /&gt;$row = mysql_fetch_row($all_Recordset1);&lt;br /&gt;$totalRows_Recordset1 = $row[0];&lt;br /&gt;$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;// record set with data&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;$Recordset1 = mysql_query($query_limit_Recordset1, $ExampleDB) or die(mysql_error());&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;// $row_Recordset1 = mysql_fetch_assoc($Recordset1);&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;header ("content-type: text/xml");&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;$xml_output = '&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;';&lt;br /&gt;$xml_output .= "&amp;lt;rows&amp;gt;";&lt;br /&gt;$xml_output .= "&amp;lt;page&amp;gt;".$pageNum_Recordset1."&amp;lt;/page&amp;gt;";&lt;br /&gt;$xml_output .= "&amp;lt;total&amp;gt;".$totalRows_Recordset1."&amp;lt;/total&amp;gt;";&lt;br /&gt;for($x = 0 ; $x &amp;lt; mysql_num_rows($Recordset1) ; $x++){&lt;br /&gt;$row = mysql_fetch_assoc($Recordset1);&lt;br /&gt;$xml_output .= '&amp;lt;row id="'.$row[$idField].'"&amp;gt;';&lt;br /&gt;$i=0;&lt;br /&gt;while ($i &amp;lt; mysql_num_fields($Recordset1)) {&lt;br /&gt;$fn=mysql_field_name($Recordset1,$i);&lt;br /&gt;// Escaping illegal characters&lt;br /&gt;if (is_null($row[$fn]))  { $fieldval=" ";} else {$fieldval  = str_replace("&amp;amp;", "&amp;amp;amp;", $row[$fn]);}&lt;br /&gt;$fieldval = str_replace("&amp;lt;", "&amp;amp;lt;", $fieldval);&lt;br /&gt;$fieldval = str_replace("&amp;gt;", "&amp;amp;gt;", $fieldval);&lt;br /&gt;$fieldval = str_replace('"', "&amp;amp;quot;",$fieldval);&lt;br /&gt;$fieldval = str_replace('"', "&amp;amp;quot;",$fieldval);&lt;br /&gt;$fieldval = str_replace("'", "&amp;amp;quot;",$fieldval);&lt;br /&gt;&lt;br /&gt;$xml_output .= "&amp;lt;cell&amp;gt;" .$fieldval . "&amp;lt;/cell&amp;gt;";&lt;br /&gt;$i++;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$xml_output .= "&amp;lt;/row&amp;gt;";&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;$xml_output .= "&amp;lt;/rows&amp;gt;";&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;echo $xml_output; &lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Normally, I do not query the database table directly, but use a view instead. This allows me to format the fields as I want (add numeric format, timezone adjustments, etc) and allows the Sql server to presort the data.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://haperez.com/examples/flexigrid5.php"&gt;Here is this example page 5 on my website&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;span style="font-size:180%;"&gt;&lt;a href="http://haperez.com/examples/flexigrid6.php"&gt;Here is a example of a grid integrated in my website.&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;I hope this helps!!!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;From the Eternally Curios Blog&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">39</thr:total></item><item><title>Photo Portfolio</title><link>http://eternallycuriousblog.blogspot.com/2011/03/photo-portfolio.html</link><author>noreply@blogger.com (Hector Perez)</author><pubDate>Thu, 24 Mar 2011 12:25:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1538939303590269982.post-5705529684275653210</guid><description>&lt;object width="425" height="425" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"&gt;&lt;param name="movie" value="http://images-community.shutterfly.com/flashapps/flashslideshowphotobook/slideshow_pb.swf"/&gt;&lt;param name="flashvars" value="xmlURL=http%3A%2F%2Fws.shutterfly.com%2Fpsdata%3FprojectGUID%3D0CatGjFm0bs9cl%26uid%3D003074314405%26size%3D0%26ts%3D1300983676000%26height%3D425%26width%3D425&amp;size=0&amp;ob=0&amp;fc=0&amp;ss=0&amp;sb=0&amp;ft=0"/&gt;&lt;param name="menu" value="false"/&gt;&lt;param name="quality" value="best"/&gt;&lt;param name="wmode" value="transparent"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;embed width="425" height="425" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="wrapper" quality="best" menu="false" allowfullscreen="true" allowScriptAccess="always" flashvars="xmlURL=http%3A%2F%2Fws.shutterfly.com%2Fpsdata%3FprojectGUID%3D0CatGjFm0bs9cl%26uid%3D003074314405%26size%3D0%26ts%3D1300983676000%26height%3D425%26width%3D425&amp;size=0&amp;ob=0&amp;fc=0&amp;ss=0&amp;sb=0&amp;ft=0" src="http://images-community.shutterfly.com/flashapps/flashslideshowphotobook/slideshow_pb.swf"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;p style="width:425px;margin-top:0;text-align:center;"&gt;&lt;a href="http://share.shutterfly.com/action/welcome?sid=0CatGjFm0bs3KA&amp;amp;eid=115"&gt;Click here to view this photo book larger&lt;/a&gt;&lt;img width="1" height="1" border="0" src="https://os.shutterfly.com/b/ss/sflyshareprod/1/H.15/111?pageName=sharekey&amp;c1=photobook&amp;c2=blogger" /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;From the Eternally Curios Blog&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><enclosure length="145126" type="application/x-shockwave-flash" url="http://images-community.shutterfly.com/flashapps/flashslideshowphotobook/slideshow_pb.swf"/><itunes:explicit>no</itunes:explicit><itunes:subtitle>Click here to view this photo book largerFrom the Eternally Curios Blog</itunes:subtitle><itunes:author>noreply@blogger.com (Hector Perez)</itunes:author><itunes:summary>Click here to view this photo book largerFrom the Eternally Curios Blog</itunes:summary></item><item><title>Return</title><link>http://eternallycuriousblog.blogspot.com/2010/12/back-from-panama.html</link><author>noreply@blogger.com (Hector Perez)</author><pubDate>Thu, 2 Dec 2010 12:22:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1538939303590269982.post-6100216036527176586</guid><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://lh5.ggpht.com/_suCM7hDRzAI/TPagSvMggPI/AAAAAAAAKp0/Jn03tFXYUUM/s144/PAN_-_La%20Planta_2010-11-25-151937_200.JPG"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 144px; height: 108px;" src="http://lh5.ggpht.com/_suCM7hDRzAI/TPagSvMggPI/AAAAAAAAKp0/Jn03tFXYUUM/s144/PAN_-_La%20Planta_2010-11-25-151937_200.JPG" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Back from Panama. will post soon.&lt;div class="blogger-post-footer"&gt;From the Eternally Curios Blog&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="http://lh5.ggpht.com/_suCM7hDRzAI/TPagSvMggPI/AAAAAAAAKp0/Jn03tFXYUUM/s72-c/PAN_-_La%20Planta_2010-11-25-151937_200.JPG" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Will Apple ever allow Flash on its IPads and IPhones?</title><link>http://eternallycuriousblog.blogspot.com/2010/04/will-apple-ever-allow-flash-on-its.html</link><author>noreply@blogger.com (Hector Perez)</author><pubDate>Mon, 12 Apr 2010 19:33:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1538939303590269982.post-5119698407164545146</guid><description>Since Apple’s IPhone release in June 29, 2007, the IPhone has not supported Adobe Flash; and it doesn’t look like it will in the future. Apple stand on not supporting Flash is a business decision.  Apple originally gave the excuse that Flash would slow down the IPhone browser and left it out for performance issues.&lt;br /&gt;&lt;br /&gt;  That was 3 years ago, now millions of IPhones and thousands of applications latter still no Flash.  It’s not because the new phones can perform. It’s just that Apple would not like to see developers creating apps in flash that will work for IPhone and rivaling phones. Apple would not be able to control their products and applications as tightly as they have.  They control the content, appearance, and ultimately the business of all the companies that make applications for the device. Think of it as a commercial big brother or China.  If the government had such control of your phone people would be protesting on the street but Apple veneer of “we are cool, we are cheek, we are good” and quality of its products have for a time quieted most voices. But lets not forget; Apple is a business. They have stockholders and employees. They have to make a profit or the company will fail, a large profit for the company to succeed. Apple will not purposely hurt its bottom line by providing a way for customers to move away from their app store.  They will continue to restrict and control their products for as long as they can.  You don’t believe me? Why does the IPhone does not have a flash card reader? No USBs? Why did it take so long for Spype, Google, and others apps to be approved? Apple used every excuse that they could, without actually saying no.&lt;br /&gt;&lt;br /&gt;  So will Flash ever get to the IPhone… I think eventually it will. Eventually the excuses will run out. But Apple is hoping that they can delay it long enough that everyone who wants content will move to HTML5. Which they will find a way to control too.&lt;div class="blogger-post-footer"&gt;From the Eternally Curios Blog&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>How to filter messages on GMAIL</title><link>http://eternallycuriousblog.blogspot.com/2010/03/how-to-filter-messages-on-gmail.html</link><category>gmail</category><author>noreply@blogger.com (Hector Perez)</author><pubDate>Mon, 29 Mar 2010 15:25:00 -0400</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1538939303590269982.post-1671412416209617778</guid><description>GMail has a great little function call &lt;span style="font-weight: bold;"&gt;filters&lt;/span&gt; that can help you organize your email quickly by automatically adding labels or executing a special action. I use it to organize my incoming emails by category so I can see important things like ebills together and non important things like my Netflix responses that I don't keep for long and usually delete soon after. You can create as many filters as you want on GMail.&lt;br /&gt;&lt;br /&gt;Lets start by first going to your GMail inbox.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://lh3.ggpht.com/_suCM7hDRzAI/S7D_HzCzAwI/AAAAAAAAJzM/mNGDhX21zCg/s400/2010-03-15_1951.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 312px;" src="http://lh3.ggpht.com/_suCM7hDRzAI/S7D_HzCzAwI/AAAAAAAAJzM/mNGDhX21zCg/s400/2010-03-15_1951.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Then open an email that you want to add a filter to. You will see a button  "More Actions" on top of the email. Press it and select "Filter messages like this"&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://lh6.ggpht.com/_suCM7hDRzAI/S7EEBAvcYgI/AAAAAAAAJ0Q/us_UoyRhMgc/s400/2010-03-15_1953.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 313px;" src="http://lh6.ggpht.com/_suCM7hDRzAI/S7EEBAvcYgI/AAAAAAAAJ0Q/us_UoyRhMgc/s400/2010-03-15_1953.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;On the next screen, in the  "Create Filter" section verify that you have chosen the right senders email. You can all additional parameters on the other boxes. Then press the "Next Step" button.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://lh6.ggpht.com/_suCM7hDRzAI/S7EECU5zcnI/AAAAAAAAJ0Y/Gd5VvBfD2g4/s400/2010-03-15_1956.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 312px;" src="http://lh6.ggpht.com/_suCM7hDRzAI/S7EECU5zcnI/AAAAAAAAJ0Y/Gd5VvBfD2g4/s400/2010-03-15_1956.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On the "Create Filter" section select the actions you want to take with this filter. I usually use a filter to add a new label automatically. Check the apply filter to the following xxx conversations so that the filter will be applied to previous emails that meet the criteria. When finished click on the "Create Filter" button .&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://lh6.ggpht.com/_suCM7hDRzAI/S7EED6BVrOI/AAAAAAAAJ0g/vuSmGHpTnAw/s400/2010-03-15_1958.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 313px;" src="http://lh6.ggpht.com/_suCM7hDRzAI/S7EED6BVrOI/AAAAAAAAJ0g/vuSmGHpTnAw/s400/2010-03-15_1958.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Under "Settings" the status will be updated and your new filter will be added.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://lh4.ggpht.com/_suCM7hDRzAI/S7EEEjzQW5I/AAAAAAAAJ0o/eQHPfSwqQLE/s400/2010-03-15_2000.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 313px;" src="http://lh4.ggpht.com/_suCM7hDRzAI/S7EEEjzQW5I/AAAAAAAAJ0o/eQHPfSwqQLE/s400/2010-03-15_2000.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now if select your label all of the emails that meet your criteria will be selected and label automatically.  You can now organize your emails more quickly&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://lh5.ggpht.com/_suCM7hDRzAI/S7EEFqqVeAI/AAAAAAAAJ0w/tLO3FLrbevE/s400/2010-03-15_2002.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 313px;" src="http://lh5.ggpht.com/_suCM7hDRzAI/S7EEFqqVeAI/AAAAAAAAJ0w/tLO3FLrbevE/s400/2010-03-15_2002.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This was just a brief tutorial but it is a great feature of GMail that I use often.&lt;div class="blogger-post-footer"&gt;From the Eternally Curios Blog&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="http://lh3.ggpht.com/_suCM7hDRzAI/S7D_HzCzAwI/AAAAAAAAJzM/mNGDhX21zCg/s72-c/2010-03-15_1951.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>Windows Phone 7 Series: Microsoft&amp;#39;s Fresh Start</title><link>http://eternallycuriousblog.blogspot.com/2010/02/windows-phone-7-series-microsoft-fresh.html</link><author>noreply@blogger.com (Hector Perez)</author><pubDate>Tue, 16 Feb 2010 11:17:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1538939303590269982.post-6245983240268242354</guid><description>&lt;a href=http://www.pcworld.com/article/189426/windows_phone_7_series_microsofts_fresh_start.html&gt;Windows Phone 7 Series: Microsoft's Fresh Start&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Posted using &lt;a href="http://sharethis.com"&gt;ShareThis&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;From the Eternally Curios Blog&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Alternatives to Photoshop, Dreamweaver and InDesign</title><link>http://eternallycuriousblog.blogspot.com/2010/02/alternatives-to-photoshop-dreamweaver.html</link><author>noreply@blogger.com (Hector Perez)</author><pubDate>Mon, 15 Feb 2010 14:40:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1538939303590269982.post-1388739860735819486</guid><description>&lt;a href=http://haperez.podbean.com/2010/02/15/alternatives-to-photoshop-dreamweaver-and-indesign/&gt;Alternatives to Photoshop, Dreamweaver and InDesign&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Posted using &lt;a href="http://sharethis.com"&gt;ShareThis&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;From the Eternally Curios Blog&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Page 2 - 10 Reasons Why a Google Fiber Network Could Reshape the ISP Landscape - IT Infrastructure from eWeek</title><link>http://eternallycuriousblog.blogspot.com/2010/02/page-2-10-reasons-why-google-fiber.html</link><author>noreply@blogger.com (Hector Perez)</author><pubDate>Fri, 12 Feb 2010 00:35:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1538939303590269982.post-8487285715966234771</guid><description>&lt;a href=http://www.eweek.com/c/a/IT-Infrastructure/10-Reasons-Why-a-Google-Fiber-Network-Could-Reshape-the-ISP-Landscape-732801/1/&gt;Page 2 - 10 Reasons Why a Google Fiber Network Could Reshape the ISP Landscape - IT Infrastructure from eWeek&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Posted using &lt;a href="http://sharethis.com"&gt;ShareThis&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;From the Eternally Curios Blog&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Need to learn about technology? Ask your kids!</title><link>http://eternallycuriousblog.blogspot.com/2010/01/need-to-learn-about-technology-ask-your.html</link><category>help</category><category>Technology</category><author>noreply@blogger.com (Hector Perez)</author><pubDate>Mon, 25 Jan 2010 18:33:00 -0500</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1538939303590269982.post-612964120972355742</guid><description>For many years I have served as my family and friends their technology installer, support, teacher and serviceman. It's a infamous position by my background and my incessant need to thinker with technology. I however have found a way to reduce the urgent phone calls at all times of day. &lt;br /&gt;&lt;br /&gt;I simple tell then to find a teenager (hopefully your own) and ask for help. &lt;br /&gt;&lt;br /&gt;You get the following advantages:&lt;br /&gt;&lt;br /&gt;The usually understand the technology much better. They literally grew up on it.&lt;br /&gt;&lt;br /&gt;They get show off, allowing to impress their elders and develop a rapport. You will be amazed on how much of this technology they have learned.&lt;br /&gt;&lt;br /&gt;They are usually more available and free!&lt;div class="blogger-post-footer"&gt;From the Eternally Curios Blog&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item></channel></rss>