Notice: Undefined index: price in C:\xampp\htdocs\RK_files\update.php on line 34
Notice: Undefined index: coname in C:\xampp\htdocs\RK_files\update.php on line 35
Notice: Undefined index: destination in C:\xampp\htdocs\RK_files\update.php on line 36
Please Help me!
- Code: Select all
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" href="main.css" type="text/css">
</head>
<body background="media/dark_blue_background-wallpaper-1920x1200.jpg">
<center>
<?php
session_start();
if ($_SESSION['uname']) {
?>
<div id="bus">
<p><img src="media/rk_logo2.png" height="100" width="220"></p>
<ul>
<li style="float: right; padding-right: 10px; font-family: sans-serif; font-weight: bold;">You are Logged in as, <?php echo "" . $_SESSION['uname'] . "!"; ?></li>
</ul><br>
<div id="menu">
<ul>
<li><a href="add.php">Add Bus and Service</a></li>
<li><a href="edit.php">Change Bus and Service</a></li>
<li><a href="del.php">Delete Bus and Service</a></li>
<li><a href="show.php">View Bus and Service</a></li>
</ul>
</div>
<?php
}
$rate1 = $_POST['price'];
$company1 = $_POST['coname'];
$destination1 = $_POST['destination'];
$connect = mysql_connect("localhost", "root", "pranit");
if (!$connect) {
die("could not connect" . mysql_error());
}
mysql_select_db("rk_bookings", $connect);
$query = mysql_query("UPDATE bus_details SET price='$rate1' WHERE company='$company1' AND destination='$destination1'");
if ($query) {
echo "Records Updated!!!";
} else {
echo mysql_error();
}
mysql_close($connect);
?>
</body>
</html>

