Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

It may be necessary The Delete query function will allow you to delete a query you have previously created.

In order to do so you will need to know the unique QueryID for the query to be deleted.

...

Code Block
languagephp
themeRDark
firstline1
titleCode Block Example
linenumberstrue
//Include the analytics class and the configuration class
$t->runInteraction("Analytics.class.php");
$t->runInteraction("Config.class.php");
 
//Create our query object
$query = new Query(Config::$ANALYTICS_ANALYST);

//QueryID you wish to delete
$queryId = "56de2fr0219b38e071aac27e";
 
//Call the delete query function
$response = $query->delete($queryId);


Explanation:

 

//delete the query, remembering to pass in the queryId for the query to deleted 
$response = $query->delete($queryId);

Delete This function will delete the query , remembering to pass you specify in the correct QueryID$queryId variable.

$queryId (string)

This is the Query ID of the query you wish to delete. 
Please see You can use the List (Read) Saved Queries for more information function to find your query ID, if you're not sure.

Return:

If the delete was successful the response would be boolean TRUE. If you try to delete a query that does not exist,  it will return boolean FALSE.

Code Block
themeRDark
titleReturn
//If delete was successful 
 
1
 
//If delete was unsuccessful