JustPaste.it

I have query which works from php script.
I get this string from my cp program and set to $cmd

how to call $cmd (below) so it runs sqlite query?


$db = new SQLite3('/opt/lampp/htdocs/sql/mydb.sq3'); $sql = "SELECT * FROM items_2 WHERE price < 3.00"; $result = $db->query($sql); while ($row = $result->fetchArray(SQLITE3_ASSOC)){ echo $row['name'] . ': $' . $row['price'] .'<br>'; } unset($db);

<?php

$output=null;
$retval=null;

exec('/opt/lampp/htdocs/build/test 123', $output, $retval);

 


  $cmd  = $output;
  $cmd  = implode("\n ", $cmd);

 echo $cmd;
exec($cmd);


print_r($cmd);
?>