Question: ```
$current = $_GET['current'];
$future = $_GET['future'];
//$CMD = $_GET['CMD'];

$current = mktime(0,0,0,date("m"),date("d"),date("Y"));
$currentDate = date("Y-m-d",$current);

$future = mktime(0,0,0,date("m"),date("d")+7,date("Y"));
$futureDate = date("Y-m-d", $future);
//need to get the futureDate for URL
//$futrureDate = date("Y-m-d",$_GET['finalDate'])

// build feed URL
$googleURL = "http://www.google.com/calendar/feeds/$userid/private-$magicWord/basic?start-min=$currentDate&start-max=$futureDate/full?alt=json";
//$googleURL = "http://www.google.com/calendar/feeds/$userid/private-$magicWord/basic?alt=json";
//$url = "http://www.google.com/calendar/feeds/developer-calendar@google.com/public/full?alt=json";
$data = file_get_contents($googleURL);
echo $data;
//$json = json_encode($data);
//echo $json;
//By default json_decode returns an stdClass object. You have to give a second parameter for this function TRUE.
$object = json_decode($json,TRUE);
print_r($object->title[1]);

//echo $object->title[0];

```

Where do I put the alt=json in the url with the date variables. It works fine when i exclude the dates from the url but then its invalid with them. also when i try to print a specific object i get an error that the object doesn't exist. thank you!

Answer: 
You can simply create a multiple-column index on these columns and enforce uniqueness: see the MySQL manual at <http://dev.mysql.com/doc/refman/5.0/en/multiple-column-indexes.html>. 

For example, in a table with columns `id` (unique primary key), `colA` and `colB`, you run: 

```
ALTER TABLE table ADD UNIQUE KEY (colA,colB)

```

This is it: any INSERTs leading to a duplicate entry in these two columns combined will now return a MySQL error instead of going through. If you use `INSERT IGNORE`, no MySQL error will be thrown if executing it would violate this unique constraint, and your `INSERT` statement would be quietly disregarded.
To make unique index for text types you can use

```
CREATE UNIQUE INDEX indexname ON `tablename` (columnname (100));

```

(100) here after columnname tells mysql to check only first 100 bytes as unique, if you specify (4) as length then both

```
hello
hello world

```

are same as index (both are actually `hell` in index tree) and mysql does not allow to insert them to table.

See here <http://dev.mysql.com/doc/refman/5.0/en/create-index.html>