<th>11.10-12.00</th> <th>12.00-12.50</th> <th>1.30-2.20</th> <th>2.20-3.10</th> <th>3.10-4.00</th> <th>4.00-4.50</th> </tr> </thead> <tbody> <?php $time2d = array(array()); $subject = array(); // put your code here require_once './dbinfo.php'; if (isset($_POST['submit'])) { if (callConnect()) { $sem = trim($_POST['sem']); subject($sem); } } function subject($semester) { $i = 0; $j; $k = 0; $query = "SELECT * FROM subject WHERE sid = {$semester}"; $execute = mysql_query($query) or die("Error in {$query} ->" . mysql_error()); while ($row = mysql_fetch_assoc($execute, MYSQL_ASSOC)) { $subject[$i] = $row['sname']; faculty($row['subid']); $i++;
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ require_once './dbinfo.php'; callConnect(); function unallot() { $query = "UPDATE faculty SET alloted = 0"; $result = mysql_query($query); if ($result) { echo "Updated Successfully"; } else { echo "Error " . mysql_error(); } } function emptyy() { $query = "TRUNCATE TABLE fixslot"; $result = mysql_query($query) or die(mysql_error()); if ($result) { echo "Success"; } else { mysql_error(); } } ?>
<?php header('Content-Type: text/html; charset=utf-8'); require_once 'connect.php'; function callConnect() { return connect(); } $con = callConnect(); echo " Test Connection (Empty means No Error) = " . mysqli_error($con); mysqli_close($con) or die("Can't Close Connection");