ممكن احد يساعدني بتصحيح الاخطاء الموجود بهالكود
<html>
<head><title>ttt</title>
<meta charset="utf-8" />
<style type="text/css">
table.imagetable {
font-family: verdana,arial,sans-serif;
font-size:14px;
color:#333333;
border-width: 1px;
border-color: #999999;
border-collapse: collapse;
}
table.imagetable th {
background:#71c7d1 ;
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #999999;
}
table.imagetable td {
background:#e6f0f1 ;
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #999999;
}
</style>
</head>
<body>
<form method="post" action="ss.php">
<input placeholder="القسم" name="department" type="text" autofocus/>
<input placeholder="المرحلة" name="stage" type="text" value=""/>
<input placeholder="المادة" name="subj" type="text" value=""/>
<button name="search" type="submit" value="dispaly">ابحث</button>
<table class="imagetable">
<tr>
<th>ID</th><th>اسم الطالب </th><th>الدرجة</th>
</tr>
<?php
include("database/db_conection_student.php");
include("database/db_conection_instructor.php");
if(isset($_POST['search']))
{
$department=$_POST['department'];
$stage=$_POST['stage'];
$subject=$_POST['subj'];
$dis="select * from student WHERE ( department ='$department' AND stage='$stage') AND
(subj1='$subject' OR subj2='$subject' OR subj3='$subject' OR subj4='$subject' OR subj5='$subject' OR subj6='$subject' OR subj7='$subject' )" ;
$get="select * from instructors WHERE sub1 ='$subject' OR sub2 ='$subject' OR sub3 ='$subject' " ;
$run=mysqli_query($dbconst,$dis);
$runn=mysqli_query($dbconin,$get);
while($row=mysqli_fetch_array($runn))
{
while($row=mysqli_fetch_array($run))
{
$user_id=$row[0];
$fullname=$row[1];
?>
<tr><td><?php echo $user_id; ?></td>
<td><?php echo $fullname; ?></td>
<td><input placeholder="الدرجة" name="score" type="text" size="2"/></td>
<td> <button name="add" type="submit" value="dispaly">أضافة</button></td></tr> </form>
<?php
} }
}?>
</table>
</body>
</html>
<?php
include("database/db_conection_student.php");
if(isset($_POST['add']))
{
$department=$_POST['department'];
$stage=$_POST['stage'];
$subject=$_POST['subj'];
$score=$_POST['score'];
$check="select * from student WHERE ( department ='$department' AND stage='$stage') AND
(subj1='$subject' OR subj2='$subject' OR subj3='$subject' OR subj4='$subject' OR subj5='$subject' OR subj6='$subject' OR subj7='$subject' )";
$sc=mysqli_query($dbconst,$check);
while($row=mysqli_fetch_array($sc))
{
$fullname=$row[1];
}
$sco="insert into scores (stu_name,subject,score) VALUE ('$fullname','$subject','$score')";
if(mysqli_query($dbconst,$sco))
{
echo"<script>alert('Data Saved Successfully')</script>";
}
else{
echo"<script>alert('UNSuccessfully')</script>";
}
}
?>
تعبت و مجاي يضبط :(