Example #1
0
// you MUST include "SQL_CALC_FOUND_ROWS" after the SELECT clause and not have any LIMIT or ORDER BY clauses!
//
// $table->fetchData("SELECT SQL_CALC_FOUND_ROWS <FIELD1>,<FIELD2> FROM <DATABASE_TABLE> WHERE <etc..>");
$o2 = array();
$o2["database"] = array();
$o2["database"]["name"] = DATABASE_NAME;
$o2["database"]["username"] = DATABASE_USER;
$o2["database"]["password"] = DATABASE_PASS;
$o2["database"]["table"] = "tablegear";
$o2["database"]["utf8"] = true;
$query = "select SQL_CALC_FOUND_ROWS * from tablegear where description like 'a%'";
$table->fetchData($query);
$o2["database"]["noAutoQuery"] = true;
$t2 = new TableGear($o2);
$q2 = "select SQL_CALC_FOUND_ROWS * from tablegear where description like 'b%'";
$t2->fetchData($q2);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>TableGear for jQuery</title>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  <script type="text/javascript" src="../lib/javascripts/tablegear-jquery.js"></script>
  <link type="text/css" rel="stylesheet" href="../lib/stylesheets/tablegear.css" />
  <style type="text/css">

.wowzers {
  background-color: #ffe2e2;
}
Example #2
0


// Instanciates the table. This must be included here!

$table = new TableGear($options);



// If you need to use a custom query instead of the default (fetching everything), you can specify it here.
// You can use any syntax in the query you want, however you MUST include the primary key field in the SELECT
// clause, otherwise none of the editing functionality will work! Also, if you need pagination on the table
// you MUST include "SQL_CALC_FOUND_ROWS" after the SELECT clause and not have any LIMIT or ORDER BY clauses!
//

$table->fetchData("SELECT SQL_CALC_FOUND_ROWS id,price,memory FROM labs_tablegear WHERE price > 400");







?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>TableGear for jQuery</title>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  <script type="text/javascript" src="../lib/javascripts/tablegear-jquery.js"></script>