User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 373,930 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,255 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 MySQL advertiser:
Views: 2191 | Replies: 2
Reply
Join Date: Oct 2007
Posts: 3
Reputation: jamez333 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jamez333 jamez333 is offline Offline
Newbie Poster

Question Cannot get php script to enter data

  #1  
Oct 29th, 2007
I am trying to use this script to enter data into my database from an html form.
<!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>

<?
$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?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Posts: 4,588
Reputation: iamthwee is a jewel in the rough iamthwee is a jewel in the rough iamthwee is a jewel in the rough iamthwee is a jewel in the rough 
Rep Power: 15
Solved Threads: 293
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Industrious Poster

Re: Cannot get php script to enter data

  #2  
Oct 31st, 2007
When you won't work. Tell us exactly what you mean?!
Last edited by iamthwee : Oct 31st, 2007 at 6:33 pm.
Member of: F-ugly code club

Join today don't delay!
Reply With Quote  
Join Date: Sep 2007
Location: Budapest
Posts: 251
Reputation: fatihpiristine has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 12
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: Cannot get php script to enter data

  #3  
Nov 1st, 2007
general mistake :

change $_post tags to $_request

you already posted the values... why you post them again on page itemENTRY.php

funny
Do a favour, leave me alone
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MySQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 6:02 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC