-
Notifications
You must be signed in to change notification settings - Fork 0
/
topicForm.php
33 lines (31 loc) · 912 Bytes
/
topicForm.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* Created by PhpStorm.
* User: alihamza
* Date: 5/19/18
* Time: 2:12 PM
*/
session_start();
include_once ("connection.php");
if(isset($_POST['submit']))
{
$rollNo=$_SESSION['rollNo'];
// echo $_SESSION['rollNo']."<br>";
foreach($_POST as $value)
{
$getSubjectId="select subjectId from subjects where lower(subjectName) = "."'".strtolower($value)."'";
if(strlen($value)>0)
{
$getResult=mysqli_query($conn,$getSubjectId);
// echo $getResult;
$res=$getResult->fetch_assoc();
// echo $getSubjectId."<br>";
if($res['subjectId'])
{
$insertInUserBridge="INSERT INTO subjectsUserBridge (rollNo,subjectId) values ('".$rollNo."','".$res['subjectId']."')";
mysqli_query($conn,$insertInUserBridge);
}
}
}
header("Location: pic.php");
}