Jump to content

PHP will not insert my data into mysql


brucegregory

Recommended Posts

I know their is an error somewhere in this code, but I have looked for hours and found a few syntax errors. My code will not give back any errors, it will just simply not insert into the database. If you see anything please let me know.

 

Thanks!

 

<?php
session_start();
$username=$_SESSION['username'];
if($username==''){
header("location:http://192.168.2.2/login.php");
} 

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

mysql_select_db("main", $con);

mysql_query("INSERT INTO quote_sheet (customer, attn, phone, fax, date, part, description, material, shipping, exceptions, tool_deliver_qty, tool_delivery_price, production_delivery_qty, production_delivery_price, other01, other02, other03, quoted_by, grams, surf_area, tons, density, lbs_min_parts, vsp1, lbs_mil_min, percent1, percent3, vsp2, ton_press2, pcs_hour1, pcs_hour2, sintered1, sintered2, sec_1, sec_2, sec_3, sec_4, sec_5, sec_6, sec_7, sec_8, set_up_charges, manu_costs, comm, tool, spec, lbs_mil_min2 )
VALUES ('$_POST[customer]','$_POST[attn]','$_POST[phone]', '$_POST[fax]', '$_POST[date]','$_POST[part]', '$_POST[description]', '$_POST[material]','$_POST[shipping]', '$_POST[exceptions]', '$_POST[tool_delivery_qty]','$_POST[tool_delivery_price]', '$_POST[production_delivery_qty]', '$_POST[production_delivery_price]','$_POST[other01]', '$_POST[other02]', '$_POST[other03]','$_POST[quoted_by]', '$_POST[grams]', '$_POST[surf_area]','$_POST[tons]', '$_POST[density]', '$_POST[lbs_mil_parts]','$_POST[vsp1]', '$_POST[lbs_mil_min]', '$_POST[percent1]', '$_POST[percent3]', '$_POST[vsp2]','$_POST[ton_press2]', '$_POST[pcs_hour2]', '$_POST[sintered1]','$_POST[sintered2]', '$_POST[sec_1]', '$_POST[sec_2]','$_POST[sec_3]', '$_POST[sec_4]', '$_POST[sec_5]','$_POST[sec_6]', '$_POST[sec_7]', '$_POST[sec_8]','$_POST[set_up_charges]', '$_POST[manu_costs]', '$_POST[comm]', '$_POST[tool]', '$_POST[spec]', '$_POST[lbs_mil_min2]'");

mysql_close($con);

echo 'Quote Successfully Inserted';

?>

Link to comment
https://forums.phpfreaks.com/topic/264552-php-will-not-insert-my-data-into-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.