Jump to content

Queries to save a show and hide form.


claro

Recommended Posts

Greetings! I'm new in phpmysql.

 

Am making signup form with three users (Admin, office and student), that when student is selected there will be another form that need to fill up and the data is saved in different table. Below are my codes when the data of admin and office are submitted.

mysql_query("INSERT INTO tbl_user (user_Id,user_Password,user_Fname,user_Lname,user_Sex,user_Level,user_Program) 
                VALUES               ('$userid','$password','$fname','$lname','$sex','$level','$program')");

 

these things here are codes for student when submitted

mysql_query("INSERT tbl_studenroll (user_Id, course_Id, ap_Id, se_Sem, se_Yearlevel) 
	VALUES     ('$userid','$course', '$acadyear', '$sem', '$year')") or die(mysql_error());

             $seID = mysql_query ("SELECT max(se_Id) AS mxSEid FROM tbl_studenroll")or die (mysql_error());
             $seID1 = mysql_fetch_assoc($seID);
             $seID = $seID1['mxSEid'];

             $offcourse = mysql_query("SELECT office_Id FROM tbl_offcourse WHERE course_Id = '$course'")or die (mysql_error());
             while ($row = mysql_fetch_array($offcourse))
             {
$off = $row['office_Id'];
          mysql_query("INSERT tbl_data (se_Id,office_Id,user_Id,course_Id) VALUES ('$seID','$off','$userID','$courseID')") or die(mysql_error());
             }

 

sEE that I am saving in three tables at the same time when student is selected.

How can I do it? I want to save only what for students and for other users..I tried my codes but when I submit data from office, it saves data to studenroll, but in 0 value. hope I am clear, help me guys! thank you in advace.

Link to comment
https://forums.phpfreaks.com/topic/249681-queries-to-save-a-show-and-hide-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.