cant update through html table

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
hren
Forum Newbie
Posts: 3
Joined: Wed Mar 24, 2010 12:25 am

cant update through html table

Post by hren »

hi, my code is

Code: Select all

?php
include("/var/lib/content/www/dbcon.php");
mysql_select_db("tehnik", $con);
 
mysql_query("UPDATE 4asti SET partAmount = '36'
WHERE partName = 'kabel utp'");
 
mysql_close($con);
?>
 
and the table code is:

Code: Select all

<html>
<body>
 
<form action="sklad_zarejdane_un.php" method="get">
partName: <input type="text" name="partName" />
partAmount: <input type="text" name="partAmount" />
<input type="submit" />
</form>
 
</body>
</html>
 
and the problem is that after executing the table part Amount stays 36.

thanks in advanced
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: cant update through html table

Post by Christopher »

You need to get the form values from the superglobal $_POST array.
(#10850)
hren
Forum Newbie
Posts: 3
Joined: Wed Mar 24, 2010 12:25 am

Re: cant update through html table

Post by hren »

10x that worked.i all most new it,but when i tried as u told me and read a little beat more i understood that my php was with GlOBALS turned off from php.ini
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: cant update through html table

Post by Christopher »

hren wrote:... my php was with GlOBALS turned off from php.ini
That is good. Register globals is a possible security problem.
(#10850)
Post Reply