This program is always unable to submit the data in the generated interface, always prompt with the asterisk information is not complete, but I did fill in the complete
This post was last edited by jackbill43 on 2013-08-15 15:09:41
Beginner's Advice
<title>Classroom Additions/Modifications</title>
Include_once ("base-class.php");
New SAE Database Class
$mysql = new Saemysql ();
Get the Classroom ID number that needs to be modified incoming
$class _id=intval ($_get["class_id"]);
Gets the operation ID of the incoming
$action =$_post["Action"];
$action = String::un_script_code ($action);
$action = string::un_html ($action);
Determine whether to modify, if the classroom ID passed in, database query to get all the content
if ($class _id)
{
$class _value= $mysql->getline ("SELECT * from class where class_id= $class _id");
if (! $class _value)
{
echo "";
Exit
}
}
If you get the Operation ID, enter or modify the operation
if ($action = = "Update")
{
Get form incoming data
$old _class_id=$_post["class_id"];
$class _name=$_post["Class_name"];
$class _number=$_post["Class_number"];
$class _fid=$_post["Class_fid"];
$class _status=$_post["Class_status"];
Incoming data filtering
$old _class_id=intval ($old _class_id);
$class _name= String::un_script_code ($class _name);
$class _number= String::un_script_code ($class _number);
$class _fid=intval ($class _fid);
$class _status= intval ($class _status);
Test Required Items
if (! $class _name | |! $class _number| |! $roster _status)
{
echo "";
Exit
}
Default parameters
$nowtime =date ("y/m/d h:i:s", Time ());
If you are modifying
if ($old _class_id)
{
$sql = "Update class set
Class_name= ' $class _name ',
Class_number= ' $class _number ',
Class_fid= ' $class _fid ',
class_status= ' $class _status ',
Edittime= ' $nowtime '
where class_id= $old _class_id ";