i am using the redhat8.0+apache2+mysql3.23+php4.2 to
finish my homework. i write a php file to update my datebase
$course[0](given value before) from the web. it's below:
<?php
mysql_connect('localhost','root'.'');
ary_request=array();
if(count($HTTP_POST_VARS)
{ while(list($key,$value)=each($HTTP_POST_VARS)
{ ary_request[$key]=$value;}
}
if($ary_request['action']=='update')
{
$query="update $course[0] set mark='$mark'
where no='student_no'";
$result=mysql_db_query("db_2",$query);
if($result)
echo "success to update";
else
echo "error";
}
?>
<form action="<? echo $PHP_SELF; ?>" method=post>
<input type=hidden name=action value=update>
<input type=text name=student_no >
<input type=text name=mark>
</form>
</html>
then when i run it, i failed to update the date of the table
but i am succed to do it in the mysql , i don't know why.
anyone can help me!! thank you very much!!!