Hi friends,
I get some error for storing into database. I given that coding.any body know pls say to me.
accep.php
<?php
$check=$_REQUEST['submit'];
mysql_connect("localhost","root","");
mysql_select_db("menus") or die(mysql_error());
$projectid=$_REQUEST['pid'];
$projectname= $_REQUEST['pname'];
$projectcat= $_REQUEST['pcat'];
$scope=$_REQUEST['psco'];
$location=$_REQUEST['plo'];
$rate=$_REQUEST['prate'];
$query="insert into order values('$projectid','$projectname','$projectcat','$scope','$location','$rate')";
$dbase=mysql_query($query) or die(mysql_error());
if($dbase==TRUE)
{
include("congrat.php");
}
?>
Detail.php
<body>
<h3> <a href="additem.php">View Menu</a></h3>
<form id="form1" name="form1" method="post" action="accep.php">
<?php
mysql_connect("localhost","root","");
mysql_select_db("menus") or die(mysql_error());
$idvalue=$_REQUEST['id'];
$result=mysql_query("select * from smenu where id='$idvalue'");
while($row=mysql_fetch_array($result))
{
$projectid=$row['id'];
$projectname= $row['main'];
$projectcat= $row['itemm'];
$scope=$row['descrip'];
$location=$row['Category'];
$rate=$row['Rate'];
}
echo "<input type='hidden' value=".$projectid." name=pid>";
echo "<input type='hidden' value=".$projectname." name=pname>";
echo "<input type='hidden' value=".$projectcat." name=pcat>";
echo "<input type='hidden' value=".$scope." name=psco>";
echo "<input type='hidden' value=".$location." name=plo>";
echo "<input type='hidden' value=".$rate." name=prate>";
/*
echo " project name is $projectname";
if($check==="Request for this")
{
echo " project id is $projectid <br>";
echo "check value is $check";
}*/
?>
<table width="380" height="363" border="0" align="center" cellpadding="4" cellspacing="3" >
<tr>
<td width="135">Item Id </td>
<td width="211"><?php echo $projectid; ?></td>
</tr>
<tr>
<td>Main Item </td>
<td><?php echo $projectname; ?></td>
</tr>
<tr>
<td>Item Name</td>
<td><?php echo $projectcat; ?></td>
</tr>
<tr>
<td height="83">Description</td>
<td><?php echo $scope; ?></td>
</tr>
<tr>
<td height="83">Category</td>
<td><?php echo $location; ?></td>
</tr>
<tr>
<td>Rate</td>
<td><?php echo $rate; ?></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input name="submit" type="submit" id="submit" value="Order this" /></td>
</tr>
</table>