PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$query="UPDATE `1st_ year_1st_sem` SET Grade = '$s_grade' WHERE Subject = '$s_subject ' ";
$result=mysql_query($query) or die ('Cannot connect to database: ' . mysql_error());
the WHERE Subject = '' is my problem.. what is the best query for this?
tnx for the person who will help me
Last edited by jhincen on Sat Aug 22, 2009 10:34 pm, edited 1 time in total.
can any one help me? i have a problem how to update the records..
example. i search the records then the records are display in this row
echo "<tr>";
echo "<form name='form' method='POST' action='1y1supdate.php'>";
echo "<td><input type='hidden' name='s_subject' value='".$row['Subject']."'>".$row['Subject']."</td>";
echo "<td>".$row['Description']."</td>";
echo "<td>".$row['Units']."</td>";
echo "<td><input type='text' style='border: none' name='s_grade' value=".$row['Grade']."></td>";
echo "<td><input type='text' style='border: none' name='s_remaks' value=".$row['Remaks']."></td>";
echo "<td><input type='submit' name='update' value='update'></td></form>";
echo "</tr>";
if(isset($_POST['update'])){
$update=$_POST['s_grade'];
$s_subject=$_POST['s_subject'];
}
$query="UPDATE `1st_ year_1st_sem` SET Grade = '$s_grade' WHERE Subject = '$s_subject'";
$result=mysql_query($query) or die ('Cannot connect to database: ' . mysql_error());
sorry for my double post...
Darhazer thank you.. without your reply i cannot do it.. and thanks for this forum. i finished my thesis ^_^