472,956 Members | 2,649 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,956 software developers and data experts.

Problem with prepare statement, MySQL, and PERL,


I have a small Perl program :
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl -w
  2. use DBI;
  3. use Mysql;
  4. $host = "";
  5. $database = "";
  6. $user = "root";
  7. $password = "a1b2c3";
  8. $db = Mysql->connect ($host, $database, $user, $password) ||
  9.          die "Cannot connect to MySQL database!\n";
  10. $create = $db->prepare ("CREATE TABLE people (
  11.                                      first varchar (32) not null,
  12.                                      last varchar (32) not null ) " );
  13. $create->execute() || die "Cannot create people file!\n";
This program can connect to MySQL fine but has an error on the prepare
statement. The error is as follows :
Expand|Select|Wrap|Line Numbers
  1. Mysql::prepare: Not defined in Mysql and not autoloadable (last try prepare) at
  2. builddb.pl line 14.
I appreciate any help you can provide.

Nov 13 '07 #1
1 2673
5,058 Expert 4TB
Hi Akino. Welcome to TSDN!

I think this problem has more to do with Perl than MySQL, so you may have better luck over in the Perl Forums. I will move this thread over there for you.
Nov 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Ravi | last post by:
Hi All, I am trying to execute a select statement using the DBI module of perl in a for loop. I am getting a strange behaviour, the select statement is excuting correctly only for the last element...
by: Joe Blower | last post by:
When I execute the following SQL statement at the mysql> prompt, I get a random result: SELECT proxy FROM proxies WHERE active = 1 ORDER BY RAND() LIMIT 1; When I wrap it in my perl code, I...
by: Peter Fleck | last post by:
I'm having some trouble updating a mysql database with a perl cgi. Here's the perl: $sql = "UPDATE grants SET agency2 = \"$agency2\" WHERE agency2 = \"$key\""; $rv = do($sql) or die "Can't...
by: smsabu2002 | last post by:
Hi, I am facing the build problem while installing the DBD-MySql perl module (ver 2.9008) using both GCC and CC compilers in HP-UX machine. For the Build using GCC, the compiler error is...
by: bastb | last post by:
Hi, We've been using the perl DBD::DB2 driver on Perl version 5.8.0 (aix_thread_multi) for a project we're working on without any problems until now. We've been using DBD::DB2 version 0.78 on...
by: howachen | last post by:
Hi, When doing mysql query (SELECT statements) in php, we often use prepare statement to prevent SQL injection. However, I just noticed that the prepare statements can SLOW the number of queries...
by: das | last post by:
Hi all I am working in Perl from last three months;but using DBI module first time. While accessing Oracle DB through Perl I got a problem given below..... when give SQL statement in mysql it is...
by: Akino877 | last post by:
Hello, I have a simple Perl program that connects to MySQL and creates a table of first names and last names. The code is as follows : #!/usr/bin/perl -w use DBI; use Mysql; use DBD::mysql;
by: troled1 | last post by:
I hace3 a script that needs to write to a mysql database after pulling records from an ACCESS database. The select there are three loops, one outer loop gets the region, the next gets each building...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.