scalar value?

A

Anonymous

Guest
Making a proggy for a friend.. plugged it in got it working with his webpage but when I add a task to this list it give the following error.. not sure what it means.

Warning: Cannot use a scalar value as an array in C:\wwwroot\Treads\plugins\extended\tasklist\tasklist.php on line 85

Code:
$sql['addpost'] = mysql_query("INSERT INTO tasklist (ID, tasktitle, taskdescription, responsible, kickedoffby, percentdone, priority, datestarted, datetobecompleted, datecompleted, appendingcomments)
VALUES ('', '$_POST[adtask_tasktitle]', '$_POST[adtask_taskdescription]', '$_POST[adtask_responsible]', '$_POST[adtask_editor]', '$_POST[adtask_percentdone]', '$priority_converted', now(), '$_POST[adtask_datetobecompleted]', '', '$_POST[adtask_appendingcomments]')");
echo "Task added good luck on getting it done. Redirecting.......";
 
First:

Use this: $_POST['whatever'] insead of $_POST[whatever].

Second:

Don't put it inside a string.
Make: $sql = "SELECT ..... VALUE('', '" . $_POST['whatever'] . "')";

;)
 
Back
Top