Skip to content

Commit

Permalink
Added method optionsInnerQuery that concatenates array into a string …
Browse files Browse the repository at this point in the history
…to build the options for an inner query.

git-svn-id: http://voip.null.ro/svn/ansql/trunk@172 dbfed7de-b0aa-0410-b6a1-c7e608b77fc9
  • Loading branch information
monica committed Jul 13, 2015
1 parent 0444884 commit d0c8d44
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -3414,6 +3414,22 @@ public function getDbEngine()
return $db_engine;
return "innodb";
}


/**
* Concatenates values from @param $options so they can be used as 'options' when building an inner query
* @param $options Array. Contains values that will be concatenated
* @return String
* Ex: array(1,2) => "'1','2'"
*/
public static function optionsInnerQuery($options)
{
if (!is_array($options) || !count($options))
return "";

$options = implode("','",$options);
return "'".$options."'";
}
}

?>
2 changes: 2 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ function errormess($text, $path=NULL, $return_text="Go back to application")
*/
function link_to_main_page($path, $return_text)
{
global $module;

if (isset($_SESSION["main"]))
$link = $_SESSION["main"];
else
Expand Down

0 comments on commit d0c8d44

Please sign in to comment.