Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions End Term Practicals/IT/07_2013721_Ayush Gandhi/q1/q1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
$con = mysqli_connect('127.0.0.1','root','');
if(!$con)
echo "Not connected to server";
else
{
if(!mysqli_select_db($con,'BookStore'))
echo "Database not selected";
else
{
$bname = $_POST['bname'];
$aname = $_POST['aname'];
$isbnno = $_POST['isbno'];
$pname = $_POST['pname'];
$publication = $_POST['publication'];
$page = $_POST['page'];
$type = $_POST['type'];
$sql = "insert into user (bname,aname,isbno,pname,publication,page,type) values ('$bname','$aname','$isbno','$pname','$publication','$page','$type')";
if(!mysqli_query($con,$sql))
{
echo "Not inserted ";
}
else
echo "Succesfulley inserted";

}
}
header("refresh:2; url=book.html");

?>
Empty file.
60 changes: 60 additions & 0 deletions End Term Practicals/IT/07_2013721_Ayush Gandhi/q2/q2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
include('config.php');
?>

<?php

$sql="SELECT * FROM users";
$result=mysqli_query($conn, $sql);

if($result!==false && $result->num_rows > 0){
?>

<table border="1px">
<thead>
<tr>
<th>BOOK ID</th>
<th>Book Name</th>
<th>Author</th>
<th>ISBN</th>
<th>Publisher</th>
<th>Publiction Year</th>
<th>Pages</th>
<th>Book Type</th>

</tr>
</thead>
<tbody>
<?php
while($row = $result->fetch_array()){?>
<tr>
<td><?php echo $row[0]?></td>
<td><?php echo $row[1]?></td>
<td><?php echo $row[2]?></td>
<td><?php echo $row[3]?></td>
<td><?php echo $row[4]?></td>
<td><?php echo $row[5]?></td>
<td><?php echo $row[6]?></td>
<td><?php echo $row[7]?></td>
<td><a href="edit.php?id=<?php echo $row[0]?>">
<input type="button" value="Edit"></a></td>
<td><input type="button" value="delete"></td>

</tr>
<?php } ?>
</tbody>
</table>
<?php }
?>


<html>

<head>

<title>User Details</title>
</head>
<body>

</body>
</html>
15 changes: 15 additions & 0 deletions End Term Practicals/IT/07_2013721_Ayush Gandhi/q2/q2config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>

<html>
<body>
<?php

$hostname = "localhost";
$username = "root";
$password = "";
$dbname = "user";

$conn = mysqli_connect($hostname, $username, $password, $dbname) or die("Connection failed: " . mysqli_connect_error());
?>
</body>
</html>
30 changes: 30 additions & 0 deletions End Term Practicals/IT/q1php.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
$con = mysqli_connect('127.0.0.1','root','');
if(!$con)
echo "Not connected to server";
else
{
if(!mysqli_select_db($con,'BookStore'))
echo "Database not selected";
else
{
$bname = $_POST['bname'];
$aname = $_POST['aname'];
$isbnno = $_POST['isbno'];
$pname = $_POST['pname'];
$publication = $_POST['publication'];
$page = $_POST['page'];
$type = $_POST['type'];
$sql = "insert into user (bname,aname,isbno,pname,publication,page,type) values ('$bname','$aname','$isbno','$pname','$publication','$page','$type')";
if(!mysqli_query($con,$sql))
{
echo "Not inserted ";
}
else
echo "Succesfulley inserted";

}
}
header("refresh:2; url=book.html");

?>
Empty file.
Binary file modified Mid Term Practicals/CSE_A/NoName/get_data.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.