hi iam working on building a website for maintaining PCs, and if anyone get in my site asking for help, if i try to answer him the answer will go to the werong person, so please any help

<meta charset='utf-8'>
<body >
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'root';
// Check connection
if (!$con)
die("can not connect" . mysql_error());
mysql_select_db('newone') or die("can not find db"); 
echo "$user_id";
$res=mysql_query("SELECT * FROM newone WHERE user_id='$user_id' ");
echo "$user_id";
$sql="UPDATE newone SET user_notes='$notes' ,user_answer='$answer'  WHERE  user_id='$user_id' ";
$res=mysql_query($sql) or die("count update".mysql_error());
echo "<meta http-equiv=\"REFRESH\"content=\"0;url=justtry2.php\">";
echo "<table border='2' heigh='1740' width='1340' bgcolor='C8B478'>
<th>نوع اخر للعطل</th>
<th>نوع العطل</th>
<th>البريد الاكتروني</th>
<th>موقع اخر</th>
<th>التاريخ والوقت</th>
  echo "<form method='post'  action='justedit.php'>";
  echo "<tr>";
 echo "<td> <input type=text  name='user_notes'  ></td>";
  echo "<td><input type=text   name='user_answer' > </td>";
  echo "<td>" . $row['user_problem'] . "</td>";
  echo "<td>" . $row['user_ectt'] . "</td>";
  echo "<td>" . $row['user_type'] . "</td>";
  echo "<td>" . $row['user_email'] . "</td>";
  echo "<td>" . $row['user_ect'] . "</td>";
  echo "<td>" . $row['user_location'] . "</td>";
  echo "<td>" . $row['user_name'] . "</td>";
  echo "<td>" . $row['join_date'] . "</td>";
  echo "<td>" . $row['user_id'] . "</td>";
  echo  "<td><input type='submit'   name='save'   value='save'></td>"; 
  echo "</tr>";
  echo "</form>";
echo "</table>";

So, when you say "the answer will go to the werong person", do you mean the record gets entered to your database with the wrong user id?

It seems like there is more code to this that could be the problem, but is this really correct $user_id=$_GET['edit']; ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.