•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,577 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,629 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1063 | Replies: 2
![]() |
•
•
Join Date: Oct 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
I am using this html form page...
and this php file to insert into my database...
Nothing happens. Can someone please help me. I am new to PHP and I desperately need to get my database functional for my business.
Thanx,
jamez@opulentworx.com
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Item Entry - Opulentworx - Private</title> </head> <body> <form action="/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>
and this php file to insert into my database...
<?
$link = mysql_connect("mysql","user","xxxxxxx");
mysql_select_db("products");
{
$sql="INSERT INTO info (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"]')";
}
mysql_close($link);
?>Nothing happens. Can someone please help me. I am new to PHP and I desperately need to get my database functional for my business.
Thanx,
jamez@opulentworx.com
•
•
Join Date: Oct 2007
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
You've defined the SQL statement as $sql, but now you need to actually do something with it. You need to call the function mysql_query with $sql as an argument.
Eg
Optionally you can use
In this case you don't really need to hold the output of the function as a variable but it's a good habit to get into.
Eg
mysql_query($sql);
Optionally you can use
$result = mysql_query($sql);
In this case you don't really need to hold the output of the function as a variable but it's a good habit to get into.
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Extracting select option fields from mySQL (PHP)
- can't binding an autoincrement field of mysql data base from vb.net (VB.NET)
- retrieving a single cell of data from a MySQL database (PHP)
- Problem inserting data into database (JSP)
- HTML Form post to PHP? (PHP)
- How do I install Apache, MySQL, PHP on Linux? (PHP)
- Experience the FASTEST MySQL and PHP Hosting | Starting @ $2.50 per month (Web Hosting Deals)
- Hardware Requirements for Fedora, Apache, MySQL and PHP on one machine (*nix Hardware Configuration)
- MySQL and PHP hosting (Linux Servers and Apache)
Other Threads in the PHP Forum
- Previous Thread: WAP and PHP
- Next Thread: Displaying Mysql rows, alternate colors?


Linear Mode