update records
Posted: Sat Aug 22, 2009 9:14 am
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
then i want to update the rows using this query
the WHERE Subject = '' is my problem.. what is the best query for this?
tnx for the person who will help me
example. i search the records then the records are display in this row
Code: Select all
echo "<tr>";
echo "<form name='form' method='POST' action='1y1supdate.php'>";
echo "<td>".$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>";
Code: Select all
$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());
tnx for the person who will help me