Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: mySQL Query Problem

by gmax (Abbot)
on Feb 11, 2003 at 21:01 UTC ( #234527=note: print w/replies, xml ) Need Help??

in reply to mySQL Query Problem

I could not replicate your problem.
I am using Perl 5.6.1, DBI 1.30 and DBD::mysql 2.1018
#!/usr/bin/perl -w use strict; use DBI; my $dbh = DBI->connect("DBI:mysql:test;host=localhost;" ."mysql_read_default_file=$ENV{HOME}/.my.cnf", undef,undef,{RaiseError => 1}); $dbh->do(qq{drop table if exists testq}); $dbh->do(qq{create table testq (i int not null, c varchar(50))}); my $sth= $dbh->prepare(qq{insert into testq values (?, ?)}); my $i = 10; my $msg = 'tengo todo por aprender ¿quien quiere enseñarme?'; $sth->execute($i, $msg); my @results = @{ $dbh->selectall_arrayref(qq{select * from testq})}; print "@$_\n" for @results; $dbh->disconnect();
This code accepts the variable, inserts it into the table and retrieves the values correctly.
Can you make a simple test case, with appropriate values, so that we can evaluate what is wrong?
Use the above code as a template.

update 12-Feb-2003 17:50 CET
Tested the above code with DBD::mysqlPP and it works as well.
Just replace the connection string with the following.
my $dbh = DBI->connect("DBI:mysqlPP:test;host=localhost;", "gmax","mysecretpwd",{RaiseError => 1});
Therefore, the placeholder mechanism is not the culprit.

update 2
The mistake is in the DBD::mysqlPP driver. Check the Changelog. Versions prior to 0.04 are affected by a quoting bug, which was corrected 20 days ago!
So, after all, the culprit was the placeholder mechanism. Just update your copy of DBD::mysqlPP
_ _ _ _ (_|| | |(_|>< _|

Replies are listed 'Best First'.
Re: Re: mySQL Query Problem
by kidd (Curate) on Feb 12, 2003 at 15:17 UTC

    Im sorry I made a major mistake...the module Im using is DBD::mysqlPP, the reason Im using the module is that my client's hosting service refuses to install the DBD::mysql module...

    Anyway I wanted to say thanks for your answers and sorry for not been clear since the begining...

    I tried to look for a new version of this module but it seems that I already have the newest one..I hope someone can help me sort this out...


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://234527]
choroba waits
[thepkd]: $aohoaoh ->{'foo'} has to be dereferenced to access its contents right?
[thepkd]: sorry. i mean $aohoaoh[0]
[GotToBTru]: $aohoaoh is an array reference tho
[thepkd]: some guy was suggesting $aohoaoh[0]->{'foo '}[0]->{}. This wouldnt work.
[GotToBTru]: you're mixing notation there I think

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2016-12-06 13:33 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (104 votes). Check out past polls.