| | |
Cannot get php script to enter data
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2007
Posts: 3
Reputation:
Solved Threads: 0
I am trying to use this script to enter data into my database from an html form.
can anyone tell me why it won't work?
MySQL Syntax (Toggle Plain Text)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Item Entry - Opulentworx - Private</title> </head> <body> <form action="/php/itemENTRY.php" method="post" id="itemENTERdb"> <input type="text" id="itemNUM"/>Item #<br> <input type="text" id="quant"/>Quantity<br> <input type="text" id="date"/>Date<br> <input type="text" id="cost"/>Cost<br> <input type="text" id="ground"/>UPS Ground<br> <input type="text" id="3day"/>3 DAY UPS<br> <input type="text" id="2day"/>2 DAY UPS<br> <input type="text" id="nextDAY"/>Next DAY UPS<br> <input type="text" id="salesTAX"/>Sales Tax<br> <input type="text" id="dFEE"/>Design Fee<br> <input type="text" id="pFEE"/>Print Fee<br> <input type="text" id="markUP"/>Mark-UP<br> <input type="text" id="subTOT"/>Sub-Total<br> <input type="text" id="flTAX"/>FL Tax<br> <input type="submit" value="Save Date"/> <input type="reset" value="Reset Date"/> </form> </body> </html>
MySQL Syntax (Toggle Plain Text)
<? $link = mysql_connect("mysql","user","XXXXXXXX"); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db("prodINFO", $link); $sql="INSERT INTO 'table1' ('itemNUM', 'quant', 'date', 'cost', 'ground', '3day', '2day', 'nextDAY', 'salesTAX', 'dFEE', 'pFEE', 'markUP', 'subTOT', 'flTAX') VALUES ('$_POST["itemNUM"]', '$_POST["quant"]', '$_POST["DATE"]', '$_POST["cost"]', '$_POST["ground"]', '$_POST["3day"]', '$_POST["2day"]', '$_POST["nextDAY"]', '$_POST["salesTAX"]', '$_POST["dFEE"]', '$_POST["pFEE"]', '$_POST["markUP"]', '$_POST["subTOT"]', '$_POST["flTAX"]')"; } if (!mysql_query($sql,$link)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($link); ?>
can anyone tell me why it won't work?
![]() |
Similar Threads
- php script for dropdown to fetch DB list and then Tables (PHP)
- cPanel: email account creation. I need help making a PHP script. (PHP)
- IP-to-Country converter (php script) (PHP)
- php script (PHP)
- question about connecting odbc to sql through php script (PHP)
- How many clients can access a PHP script at a time from a MySQL server? (MySQL)
- need help with PHP Script translation (PHP)
- php wont submit data into the database (PHP)
- Can't Enter Data Into IE 6 (Web Browsers)
Other Threads in the MySQL Forum
- Previous Thread: UK postcodes
- Next Thread: multiple search terms+fulltext search
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groupware hiring hyperic images innerjoins insert ip joebrockmeier join keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization






