error message, when i edit in php

They have: 1 posts

Joined: Aug 2012

edit.php

-: EDIT FORM :-

EDIT DATA

<?php
     
include("/includes/database.php");//database connection
     /* $continued = mysql_connect("localhost","root","OtlPHP07");
      mysql_select_db("employees");*/
?>

<?php
     
//$employee_number = $_GET["id"];
     
$order = "SELECT * FROM data_employees order by employee_number";
     
$result = mysql_query($order);
      while (
$row=mysql_fetch_array($result)){
        echo (
"<tr><td>$row[name]</td>");
        echo (
"<td>$row[employee_number]</td>");
        echo (
"<td>$row[address]</td>");
        echo (
"<td><a href=\"edit_form.php?id=$row[employee_number]\">Edit</a></td></tr>");
      }
?>

edit_form.php

Form Edit Data

Form Edit Employees Data

<?php
   
include ("/includes/database.php");//database connection
    //mysql_connect("localhost","user","OtlPHP07");
    //mysql_select_db("employees");
?>

<?php
   
    $order
= "SELECT * FROM data_employees WHERE employee_number='$id'";
   
$result = mysql_query($order);
   
$row = mysql_fetch_array($result);
?>

Name

Address

edit_data.php

<?php
//edit_data.php
include ("/includes/database.php");
$order = "UPDATE data_employees
          SET name='
$name',
              address='
$address'
          WHERE
          employee_number='
$id'";
mysql_query($order);
header("location:edit.php");
?>

They have: 1 posts

Joined: Jun 2013

whe you trying to echo i.e. echo ("<tr><td>$row[name]</td>"); do not place variable inside the double quotes .Text other than variable should be inside quotes and it should be concatenated with variable. so, the proper format is :
echo("<tr><td>".$row[name]."</td></tr>");

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.