473,396 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Problem with prepare statement, MySQL, and PERL,

Hello,

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";
  14.  
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.
  3.  
I appreciate any help you can provide.

Akino.
Nov 13 '07 #1
1 2695
Atli
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

6
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...
2
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...
0
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...
1
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...
2
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...
3
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...
3
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...
1
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;
2
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.