Hi I have a problem if someone has time:
I have a function call that query's a mysql database according to a id, then places the results in textboxes according ot their row names.The function is located is a seperate php file, and function call is in a case statement above the html.
I echoed the query and it works. The problem is it dosen't place the values it the text boxes.
function Edit_Task($task_id){
$query = "SELECT * FROM calander WHERE task_id = $task_id";
echo "<br> $query";
$result = mysql_query($query);
if(!$result){
echo "Error in Search Results". mysql_error();}
else{
$row = mysql_fetch_array($result);
echo "<br> $row";
$task_name = $row['task_name'];
$task_description = $row['task_description'];
$task_date = $row['task_date'];
$task_time = $row['task_time']; }//close else
return $row;
}
the function call:
Edit_Task($task_id);
the html text for one of the text boxes is as follows,
<tr><td>Task Name:
<input type="text" name="task_name" size="50" value="<?php echo htmlspecialchars(stripslashes($task_name)); ?>"> </td></tr>
I have used the html code before so I know it works, as well as the query, I think the problem lies in its call.
Thanks twb