oskeywoskey
07-27-2005, 04:43 AM
Can anyone help me with why am I getting this error:
Mysql:repare: Not defined in Mysql and not autoloadable (last try prepare)
I'm new to perl and mysql and I created a simple perl program to insert some hard-coded values into a
database. Note, below is just a small part of my program, the rest of my program works fine. It was
only when I tried using the insert that I got this message.
use Mysql;
use DBI;
use LWP::Simple;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
use URI::Heuristic;
#My connect
$DBHOST="localhost";
$DBNAME="database01";
$DBUSER="root";
$DBPASS="";
$db = Mysql->connect($DBHOST, $DBNAME, $DBUSER, $DBPASS);
$db->selectdb($DBNAME);
my $put_in_db = $db->prepare('INSERT INTO test_table (name, hair_color, eye_color) VALUES ("Timothy",
"Blonde", "Green")');
$put_in_db->execute();
I've installed the dbi using the perl package manager and I've tested some other code that instead of
using "INSERT", it uses a "SELECT" statement which was successful in retrieving info. from an existing
database. So it seems that perl isn't having a problem communicating with the database, or is there
still a problem??? I need some serious HELP with this one!! This is driving me nuts!!
Mysql:repare: Not defined in Mysql and not autoloadable (last try prepare)
I'm new to perl and mysql and I created a simple perl program to insert some hard-coded values into a
database. Note, below is just a small part of my program, the rest of my program works fine. It was
only when I tried using the insert that I got this message.
use Mysql;
use DBI;
use LWP::Simple;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
use URI::Heuristic;
#My connect
$DBHOST="localhost";
$DBNAME="database01";
$DBUSER="root";
$DBPASS="";
$db = Mysql->connect($DBHOST, $DBNAME, $DBUSER, $DBPASS);
$db->selectdb($DBNAME);
my $put_in_db = $db->prepare('INSERT INTO test_table (name, hair_color, eye_color) VALUES ("Timothy",
"Blonde", "Green")');
$put_in_db->execute();
I've installed the dbi using the perl package manager and I've tested some other code that instead of
using "INSERT", it uses a "SELECT" statement which was successful in retrieving info. from an existing
database. So it seems that perl isn't having a problem communicating with the database, or is there
still a problem??? I need some serious HELP with this one!! This is driving me nuts!!