Hi all whats wrong with this code,,,i am not getting error......it is showing succesfull ....but not storing data.......
<?php
include('database.php');
$ser = $_POST['service'];
$quotep = $_POST['quote_price'];
$dscnts = $_POST['discounts'];
$sertax = $_POST['service_tax'];
$prmtion = $_POST['promotion'];
$frd = $_POST['from'];
$tod = $_POST['to'];
echo $ser;
echo $quotep;
echo $dscnts;
echo $sertax;
echo $prmtion;
echo $frd;
echo $tod;
$query2 = "insert into autoalto_contractor_quotation(service, quote_price, discounts, service_tax,promotions, from, to) values ('".$ser."', '".$quotep."', '".$dscnts."','".$sertax."', '".$prmtion."', '".$frd."', '".$tod."')";
$result = mysql_query($query2);
//$res=$quotep+$sertax-$dscnts;
$check = "select * from autoalto_contractor_quotation";
if(!$check)
{
die('Could not connect: ' . mysql_error());
}
$rcheck = mysql_query($check) or die(mysql_error());
$num = mysql_num_rows($rcheck);
$rcheck = mysql_fetch_array($rcheck);
if($num == 0) // if user not found
{
$result = mysql_query($query2);
echo $User = " Successfully Created.";
}
else
{
mysql_close();
echo $User = " .";
}
if (!$result)
// header("location:test.php"); // Re-direct to index.php //header("location: //index.html"); // Re-direct to main.php
?>
This is the table structure:
service_id int(10) No auto_increment primary
service varchar(80) latin1_general_ci No
quote_price int(80) No
service_tax int(80) No
promotions varchar(1000) latin1_general_ci No
from date No
to date