Ben bir sorgu çukur bir $. Post sonucunu geçmek istiyorum.
function GetAllTasks()
{
$sql = "select t.id as task_id,
description,
createdat,
createdby,
max_requests,
max_duration,
j.name as job_name
from darkfuture.tasks t, darkfuture.jobs j
where t.job_id = j.id";
$sqlresult = mysql_query($sql)
or die("The list of works failed: ".mysql_error($this->con));
$result = array();
while($row = mysql_fetch_assoc($sqlresult))
{
$task = new TasksResult();
$task->id = $row["task_id"];
$task->description = $row["description"];
$task->createdat = $row["createdat"];
$task->createdby = $row["createdby"];
$task->max_requests = $row["max_requests"];
$task->max_duration = $row["max_duration"];
$task->job_id = $row["job_name"];
array_push($result, $task);
}
mysql_free_result($sqlresult);
return $result;
}
İşte ben onu aramak nasıl:
$tasksDB = new TasksDB();
$tasks = $tasksDB->GetAllTasks();
Şimdi ben buradan $ görevleri geçmek istiyorum:
$.post("views/insert_tasks.php",{'tasks[]': $tasks}, function(data)
{
});
I know this {'tasks[]': $tasks} it's wrong but i don't know how to do it right. Some help will be appreciated. Thanks in advance!