Re: Error while inserting data into mysql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I have attached the table structure and the PHP code.

Best,
Guru.
===Database dream

== Table structure for table dream

|------
|Field|Type|Null|Default
|------
|mwool40|varchar(100)|Yes|NULL
|gwool25|varchar(100)|Yes|NULL
|wmesh24|varchar(100)|Yes|NULL
|shkote30|varchar(100)|Yes|NULL
|scloth100|varchar(100)|Yes|NULL
|macomp40|varchar(100)|Yes|NULL
|pop|varchar(100)|Yes|NULL
|hcloth95|varchar(100)|Yes|NULL
|mwool40_qty|int(10)|Yes|NULL
|gwool25_qty|int(10)|Yes|NULL
|wmesh24_qty|int(10)|Yes|NULL
|shkote30_qty|int(10)|Yes|NULL
|macomp40_qty|int(10)|Yes|NULL
|pop_qty|int(10)|Yes|NULL
|hcloth95_qty|int(10)|Yes|NULL
|mwool40_utp|int(20)|Yes|NULL
|gwool25_utp|int(20)|Yes|NULL
|wmesh24_utp|int(20)|Yes|NULL
|shkote30_utp|int(20)|Yes|NULL
|scloth100_utp|int(20)|Yes|NULL
|macomp40_utp|int(20)|Yes|NULL
|pop_utp|int(20)|Yes|NULL
|hcloth95_utp|int(20)|Yes|NULL
|mwool40_val|int(20)|Yes|NULL
|gwool25_val|int(20)|Yes|NULL
|wmesh24_val|int(20)|Yes|NULL
|shkote30_val|int(20)|Yes|NULL
|scloth100_val|int(20)|Yes|NULL
|macomp40_val|int(20)|Yes|NULL
|pop_val|int(20)|Yes|NULL
|hcloth95_val|int(20)|Yes|NULL
|mwool40_vatr|int(10)|Yes|NULL
|gwool25_vatr|int(10)|Yes|NULL
|wmesh24_varr|int(10)|Yes|NULL
|shkote30_vatr|int(10)|Yes|NULL
|scloth100_vatr|int(10)|Yes|NULL
|macomp40_vatr|int(10)|Yes|NULL
|pop_vatr|int(10)|Yes|NULL
|hcloth95_vatr|int(10)|Yes|NULL
|mwool40_vatp|int(20)|Yes|NULL
|gwool25_vatp|int(20)|Yes|NULL
|wmesh24_vatp|int(20)|Yes|NULL
|shkote30_vatp|int(20)|Yes|NULL
|scloth100_vatp|int(20)|Yes|NULL
|macomp40_vatp|int(20)|Yes|NULL
|pop_vatp|int(20)|Yes|NULL
|hcloth95_vatp|int(20)|Yes|NULL
|mwool40_totamt|int(20)|Yes|NULL
|gwool25_totamt|int(20)|Yes|NULL
|wmesh24_totamt|int(20)|Yes|NULL
|shkote30_totamt|int(20)|Yes|NULL
|scloth100_totamt|int(20)|Yes|NULL
|macomp40_totamt|int(20)|Yes|NULL
|pop_totamt|int(20)|Yes|NULL
|hcloth95_totamt|int(20)|Yes|NULL
|total|int(20)|Yes|NULL
|trans_chgs|int(15)|Yes|NULL
|gtotal|int(20)|Yes|NULL
|rupees|varchar(100)|Yes|NULL
|//**party_name**//|varchar(400)|No|
|tin_no|varchar(50)|Yes|NULL
|invoice_no|varchar(50)|Yes|NULL
|invoice_date|varchar(20)|Yes|NULL
|order_no|varchar(15)|Yes|NULL
|order_date|varchar(20)|Yes|NULL
|dc_no|varchar(20)|Yes|NULL
|dc_date|varchar(15)|Yes|NULL
== Dumping data for table dream

<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("dream", $con);

$sql="INSERT INTO dream (mwool40, gwool25, wmesh24, shkote30, scloth100, macomp40, pop, hcloth95, mwool40_qty, gwool25_qty, wmesh24_qty, shkote30_qty, scloth100_qty, macomp40_qty, pop_qty, hcloth95_qty, mwool40_utp, gwool25_utp, wmesh24_utp, shkote30_utp, scloth100_utp, macomp40_utp, pop_utp, hcloth95_utp, mwool40_val, gwool25_val, wmesh24_val, shkote30_val, scloth100_val, macomp40_val, pop_val, hcloth95_val, mwool40_vatr, gwool25_vatr, wmesh24_vatr, shkote30_vatr, scloth100_vatr, macomp40_vatr, pop_vatr, hcloth95_vatr, mwool40_vatp, gwool25_vatp, wmesh24_vatp, shkote30_vatp, scloth100_vatp, macomp40_vatp, pop_vatp, hcloth95_vatp, mwool40_totamt, gwool25_totamt, wmesh24_totamt, shkote30_totamt, scloth100_totamt, macomp40_totamt, pop_totamt, hcloth95_totamt, total, trans_chgs, gtotal, rupees, party_name, tin_no, invoice_no, invoice_date, order_no, order_date, dc_no, dc_date)
VALUES
('$_POST[mwool40]','$_POST[gwool25]','$_POST[wmesh24]','$_POST[shkote30]','$_POST[scloth100]','$_POST[macomp40]','$_POST[pop]','$_POST[hcloth95]','$_POST[mwool40_qty]','$_POST[gwool25_qty]','$_POST[wmesh24_qty]','$_POST[shkote30_qty]','$_POST[scloth100_qty]','$_POST[macomp40_qty]','$_POST[pop_qty]','$_POST[hcloth95_qty]','$_POST[mwool40_utp]','$_POST[gwool25_utp]','$_POST[wmesh24_utp]','$_POST[shkote30_utp]','$_POST[scloth100_utp]','$_POST[macomp40_utp]','$_POST[pop_utp]','$_POST[hcloth95_utp]','$_POST[mwool40_val]','$_POST[gwool25_val]','$_POST[wmesh24_val]','$_POST[shkote30_val]','$_POST[scloth100_val]','$_POST[macomp40_val]','$_POST[pop_val]','$_POST[hcloth95_val]','$_POST[mwool40_vatr]','$_POST[gwool25_vatr]','$_POST[wmesh24_vatr]','$_POST[shkote30_vatr]','$_POST[scloth100_vatr]','$_POST[macomp40_vatr]','$_POST[pop_vatr]','$_POST[hcloth95_vatr]','$_POST[mwool40_vatp]','$_POST[gwool25_vatp]','$_POST[wmesh24_vatp]','$_POST[shkote30_vatp]','$_POST[scloth100_vatp]','$_POST[macomp40_vatp]','$_POST[pop_vatp]','$_POST[hcloth95_vatp]','$_POST[mwool40_totamt]','$_POST[gwool25_totamt]','$_POST[wmesh24_totamt]','$_POST[shkote30_totamt]','$_POST[scloth100_totamt]','$_POST[macomp40_totamt]','$_POST[pop_totamt]','$_POST[hcloth95_totamt]','$_POST[total]','$_POST[trans_chgs]','$_POST[gtotal]','$_POST[rupees]','$_POST[party_name]','$_POST[tin_no]','$_POST[invoice_no]','$_POST[invoice_date]','$_POST[order_no]','$_POST[order_date]','$_POST[dc_no]','$_POST[dc_date]')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";

mysql_close($con)
?> 
-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux