I am trying to run a mysql insert query using php exec with parameters.
Exec Code:
exec("php exec.php $parameter1 >1.log &"); // I have a 1.log with 777
In Exec.php:
include $_SERVER['DOCUMENT_ROOT']."/functions/connection.php";
if($_REQUEST['parameter1']!="")
$proxy_id=$_REQUEST['parameter1'];
else
$proxy_id= $argv[1];
mysql_query("INSERT INTO proxy_log(proxy_id,last_used_time) VALUES($proxy_id,NOW())");
But nothing is happening when I am running this. Can anybody please help on this ?
The variable
$_SERVER['DOCUMENT_ROOT']isn’t available in CLI mode. use an absolute path.$_REQUESTisn’t available either, your if statement will always go in the else part.