Example #1
0
  To call this repeatedly (and each time dropping the Redisql table, use:
    "?table=employee_data&drop=1"
*/
$database_connection['name'] = "test";
// Mysql DatabaseName
$redisql = new Predisql_Client($database_connection, $single_server, NULL);
$redisql->echo_command = 1;
$redisql->echo_response = 1;
$redisql->mysql_echo_command = 1;
$table = @$_GET['table'];
if (!$table) {
    echo "this script makes the mysql table designated by the URL variable \"table=\" schemaless<br/>";
    return;
}
$drop = @$_GET['drop'];
if ($drop) {
    try {
        $redisql->dropTable($table);
    } catch (Exception $e) {
    }
}
try {
    $redisql->importFromMysql($table);
} catch (Exception $e) {
}
$redisql->dump($table);
$wildcard = $table . ':*';
$redisql->denormalize($table, $wildcard);
echo "HGETALL {$table}:1<br/>";
print_r($redisql->hgetall("{$table}:1"));
echo "<br/>";