<?php

include 'clientlogin.php';
include 'sql.php';
include 'file.php';
include 'source/connectioninfo.php';
//get token
$token = ClientLogin::getAuthToken(ConnectionInfo::$google_username, ConnectionInfo::$google_password);
$ftclient = new FTClientLogin($token);
//show all tables
//echo $ftclient->query(SQLBuilder::showTables());
//echo "<br />";
//describe a table
//echo $ftclient->query(SQLBuilder::describeTable(358077));
//echo "<br />";
//select * from table
//echo $ftclient->query(SQLBuilder::select(358077));
//echo "<br />";
//select * from table where test=1
//echo $ftclient->query(SQLBuilder::select(358077, null, "'test'=1"));
//echo "<br />";
//select test from table where test = 1
//$ftclient->query(SQLBuilder::select(564620, array('rowid'), "'ANY PEOPLE USING PROPERTY? (HOMELESS, CHILDEN, GANGS)'=''"));
//foreach ($ftclient as $key => $value) {
//    echo "RowId: $value<br />\n";
//    }
//echo "<br />";
//select rowid from table
//echo $ftclient->query(SQLBuilder::select(358077, array('rowid')));
//echo "<br />";
//delete row 401
Esempio n. 2
0
<?php

include 'includes/clientlogin.php';
include 'includes/sql.php';
include 'includes/file.php';
echo "got here";
//get token
$token = ClientLogin::getAuthToken('*****@*****.**', 'Moloko6+7');
$ftclient = new FTClientLogin($token);
//show all tables
echo $ftclient->query(SQLBuilder::showTables());
echo "<br />";
/*
//describe a table
echo $ftclient->query(SQLBuilder::describeTable(358077));
echo "<br />";
//select * from table
echo $ftclient->query(SQLBuilder::select(358077));
echo "<br />";
//select * from table where test=1
echo $ftclient->query(SQLBuilder::select(358077, null, "'test'=1"));
echo "<br />";
//select test from table where test = 1
echo $ftclient->query(SQLBuilder::select(358077, array('test'), "'test'=1"));
echo "<br />";
//select rowid from table
echo $ftclient->query(SQLBuilder::select(358077, array('rowid')));
echo "<br />";
//delete row 401
echo $ftclient->query(SQLBuilder::delete(358077, '401'));
echo "<br />";
<?php

include '../clientlogin.php';
include '../sql.php';
include '../file.php';
//get token
$token = ClientLogin::getAuthToken('username', 'password');
$ftclient = new FTClientLogin($token);
//show all tables
echo $ftclient->query(SQLBuilder::showTables());
echo "<br />";
//describe a table
echo $ftclient->query(SQLBuilder::describeTable(358077));
echo "<br />";
//select * from table
echo $ftclient->query(SQLBuilder::select(358077));
echo "<br />";
//select * from table where test=1
echo $ftclient->query(SQLBuilder::select(358077, null, "'test'=1"));
echo "<br />";
//select test from table where test = 1
echo $ftclient->query(SQLBuilder::select(358077, array('test'), "'test'=1"));
echo "<br />";
//select rowid from table
echo $ftclient->query(SQLBuilder::select(358077, array('rowid')));
echo "<br />";
//delete row 401
echo $ftclient->query(SQLBuilder::delete(358077, '401'));
echo "<br />";
//drop table
echo $ftclient->query(SQLBuilder::dropTable(358731));
<html>

<?php 
//include the files from the PHP FT client library
include 'fusion-tables-client-php/clientlogin.php';
include 'fusion-tables-client-php/sql.php';
include 'fusion-tables-client-php/file.php';
// Table id
$tableid = 750563;
//Enter your username and password
$username = "******";
$password = "******";
// Get auth token - it would be better to save the token in a secure database
// rather than requesting it with every page load.
$token = ClientLogin::getAuthToken($username, $password);
$ftclient = new FTClientLogin($token);
// If the request is a post, insert the data into the table
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    // Insert form data into table
    $insertresults = $ftclient->query(SQLBuilder::insert($tableid, array('Name' => $_POST['name'], 'Value' => $_POST['result'], 'Location' => $_POST['location'], 'Timestamp' => time())));
    $insertresults = explode("\n", $insertresults);
    $rowid1 = $insertresults[1];
}
?>

<head>
<title>Simple Form Example</title>

<style>
  body { font-family: Arial, sans-serif; }
  #map_canvas { height: 300px; width:400px; }