mysql integer problem

jmarket

New Member
i am using following code to add data into mysql database\[code\]<?php$debdes = $_POST['debdes'];$debamt = $_POST['debamt'];$crdes = $_POST['crdes'];$cramt = $_POST['cramt'];$date = $_POST['date'];$cberror = "<h1>Data not Added</h1><br/><br/><h3>Please Follow The Instructions</h3>";include_once ("db.php");if (empty ($date)) die ("$cberror");if (empty ($debamt) && empty ($debdes) && empty ($cramt) && empty ($cramt)) die ("$cberror");if (!empty($debamt) && empty ($debdes))die ("$cberror");if (!empty($debdes) && empty ($debamt)) die ("$cberror");if (!empty($cramt) && empty ($crdes)) die ("$cberror");if (!empty($crdes) && empty ($cramt)) die ("$cberror"); $ucbook = "INSERT INTO cbook(debdes,debamt,crdes,cramt,date) VALUES ('$debdes','$debamt','$crdes','$cramt','$date');";if(mysql_query("$ucbook")){echo "<h3>One Record Updated Successfully with the following Details </h3><br/>";echo "Date = $date <br/><br/>";echo "Debt Amount =$debamt <br/><br/>";echo "Debt Description = $debdes <br/><br/>";echo "Credit Amount = $cramt <br/><br/>";echo "Credit Description = $crdes <br/><br/>";}else {echo "<be/><br/>The Following Error Occure While Updatig Data<br/><br/>";echo mysql_error(); }?>\[/code\]now the problem is that as i set the value of "debamt" as integer in mysql then error comes\[code\]Incorrect integer value: '' for column 'debamt' at row 1 \[/code\]although i did not insert value in "debamt" i am also filling other data correctly??????
 
Back
Top