update command

update command

am 20.03.2005 16:04:27 von Eko Budiharto

--0-1120303624-1111331067=:52320
Content-Type: text/plain; charset=us-ascii

Hi,
I am having problem with update command. I run it directy in the mysql console, it works. But when I run it from perl, it does not work.

here is the perl script

my $server2 = 'localhost';
my $db2 = '';
my $username2 = '';
my $password2 = '
my $dbh2 = DBI->connect("dbi:mysql:$db2:$server2", $username2, $password2);

my $query = "UPDATE flightInfo SET route='chicago, atlanta' WHERE passengerIndex='15' AND passengerName='Eko Budiharto';";

$dbh2->disconnect;
I do not why the "UPDATE" command does not work with the script. Please help. I thought I used wrong syntax.



---------------------------------
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
--0-1120303624-1111331067=:52320--

Re: update command

am 20.03.2005 20:16:34 von Robin Hughes

Is passengerIndex a numeric or varchar type? If
numeric, the problem could be the quotes around '15'.

--- Eko Budiharto wrote:
> Hi,
> I am having problem with update command. I run it
> directy in the mysql console, it works. But when I
> run it from perl, it does not work.
>
> here is the perl script
>
> my $server2 = 'localhost';
> my $db2 = '';
> my $username2 = '';
> my $password2 = ' >
> my $dbh2 = DBI->connect("dbi:mysql:$db2:$server2",
> $username2, $password2);
>
> my $query = "UPDATE flightInfo SET route='chicago,
> atlanta' WHERE passengerIndex='15' AND
> passengerName='Eko Budiharto';";
>
> $dbh2->disconnect;
> I do not why the "UPDATE" command does not work with
> the script. Please help. I thought I used wrong
> syntax.
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Small Business - Try our new resources site!



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org