Statement help

From: Ing. Branislav Gerzo (2ge_at_2ge.us)
Date: 02/07/05


Date: Mon, 7 Feb 2005 10:31:49 +0100
To: dbi-users@perl.org

Hello,

I have in mysql table "kl": ID, value, flow
now, when I run in mysql:
UPDATE kl SET value = 10, flow = value - 10 where ID = 5;
it works. But when I write that in script:

my $sth = $dbh->prepare_cached("UPDATE kl SET value = ?, flow = value - ? WHERE ID = ?");
$sth->execute( 10, 10, 5 );

I want to have prepared $sth, because I call execute in for cyclus.

it doesn't update column flow, it is always 0 (I want to know
difference between current value and value stored in db). Why it is
so?

Thanks a lot.



Relevant Pages

  • Re: Does apache stop a script mid execution ?
    ... If the user calls a time consuming script and then stops or refreshes ... How does it relate to e.g. a script performing a large mysql query? ... 2.b) how the connection is set up. ... the server stops the script execution. ...
    (comp.lang.php)
  • Re: Does apache stop a script mid execution ?
    ... If the user calls a time consuming script and then stops or refreshes ... the way the client is implemented in the php mysql extension and 2.b) how the connection is set up. ... the server stops the script execution. ...
    (comp.lang.php)
  • Re: Cyrus IMAP with pam_mysql?
    ... FreeBSD, but if you check the startup script, all the parameters are ... Default log directories are in the default data directory, ... Makefile for mysql) They are changed in the above script prior to ... imaps auth sufficient pam_unix.so ...
    (freebsd-questions)
  • Re: MySQL to SQL
    ... basically I want to take a MySql script and load it into a SQL database. ... BIOS_RELEASE_DATE datetime default NULL, ... CUSTOM_TEXT_FIELD1 mediumtext, ...
    (microsoft.public.scripting.wsh)
  • Re: mysql - kern.maxfiles limit exceeded by uid 500 please see tuning(7)
    ... Since mysql crashes after 5 days of running your script, ... better check its operation and see if it is causing your system to exceed ...
    (comp.unix.bsd.freebsd.misc)