Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
hren
Forum Newbie
Posts: 3 Joined: Wed Mar 24, 2010 12:25 am
Post
by hren » Wed Mar 24, 2010 12:31 am
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
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Wed Mar 24, 2010 1:29 am
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
Post
by hren » Thu Mar 25, 2010 12:15 am
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
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Thu Mar 25, 2010 4:21 pm
hren wrote: ... my php was with GlOBALS turned off from php.ini
That is good. Register globals is a possible security problem.
(#10850)