[SOLVED] On to the next one...not updating in database...
Posted: Mon Jun 28, 2004 12:21 am
Moving along, I have a webpage that displays the contents of students at a university and their grades from an oracle database.
I've gotten it so I can select a row in the table of users and their grades and edit them, but when it "edits" them I have it redirected to the page where the grades were listed, and they haven't changed.
It SHOULD work, I've been staring at it for hours and can't figure out why it won't.
Here's the snippet of code.
the names "student_ID," etc are defined in a form on the previous page that sends the data here. Note that when I print the variables $S_ID and $PR at the end of the script and run it, they are set to the values that I entered to edit with as they should, but the actual data in the database never changes.
feyd | switched
I've gotten it so I can select a row in the table of users and their grades and edit them, but when it "edits" them I have it redirected to the page where the grades were listed, and they haven't changed.
It SHOULD work, I've been staring at it for hours and can't figure out why it won't.
Here's the snippet of code.
Code: Select all
<?php
$S_ID=$_POST['student_id'];
$D_ID=$_POST["dtl_id"];
$PR=$_POST["points_received"];
$ANN=$_POST["annotation"];
$SD=$_POST["submission_date"];
$connect=OCILogon('username','password','orcl');
$query=OCIParse($connect,'update mgargano.student_grades set detail_id=$:bind1,points_received=:bind2,annotation=:bind3,submission_date=:bind4 where student_id=:bind5');
OCIBindByName($query, ":bind1", $D_ID);
OCIBindByName($query, ":bind2", $PR);
OCIBindByName($query, ":bind3", $ANN);
OCIBindByName($query, ":bind4", $SD);
OCIBindByName($query, ":bind5", $S_ID);
@OCIExecute($query,OCI_DEFAULT);
OCICommit($connect);
OCILogoff($connect);
$url = "http://www.cise.ufl.edu/~aantonio/Admin/Grades/grades.php"; // target of the redirect
$delay = "3"; // 3 second delay
echo '<meta http-equiv="refresh" content="'.$delay.';url='.$url.'">';
include('Header.html');
echo'<p>Database is being Updated. Please wait...;</p>';
echo'<p>Thank you for using Creation Inc.</p>';
echo $S_ID;
echo $PR;
?>the names "student_ID," etc are defined in a form on the previous page that sends the data here. Note that when I print the variables $S_ID and $PR at the end of the script and run it, they are set to the values that I entered to edit with as they should, but the actual data in the database never changes.
feyd | switched
Code: Select all
toCode: Select all
tag.[/color]