CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI:
Cannont call method "prepare" on an undefined value at /home/cgi-bin/post_to_db.cgi

 



Troy
Novice

Jul 15, 2002, 5:51 AM

Post #1 of 5 (7191 views)
Cannont call method "prepare" on an undefined value at /home/cgi-bin/post_to_db.cgi Can't Post

Hi,
I get this error when I try to run a CGI script from my browser. However when I run it from the command line I get the same error message but the actual database gets updated with the new data.

This suggests that I am accessing the database correctly but I still can't figure out what is going wrong.

Can someome help please,
TIA, - Troy


fashimpaur
User

Jul 23, 2002, 1:03 PM

Post #2 of 5 (7184 views)
Re: [Troy] Cannont call method "prepare" on an undefined value at /home/cgi-bin/post_to_db.cgi [In reply to] Can't Post

Troy,

You might want to attach the cgi program for others to look at.
Otherwise, we can guess that it is because the variable $framistan
does not contain a Widget::Object instance. However, I do not
believe in this case that will help much.

Good Luck,
Dennis

$a="c323745335d3221214b364d545".
"a362532582521254c3640504c3729".
"2f493759214b3635554c3040606a0",
print unpack"u*",pack "h*",$a,"\n\n";


Paul
Enthusiast

Jul 23, 2002, 4:52 PM

Post #3 of 5 (7180 views)
Re: [Troy] Cannont call method "prepare" on an undefined value at /home/cgi-bin/post_to_db.cgi [In reply to] Can't Post

A few possible reasons...your sql server went "offline" or shutdown/restarted. Or as fishimpaur said, your object isn't created or you aren't using your statement/database handles properly.


Troy
Novice

Jul 24, 2002, 1:52 AM

Post #4 of 5 (7176 views)
Re: [RedRum] Cannont call method "prepare" on an undefined value at /home/cgi-bin/post_to_db.cgi [In reply to] Can't Post

Code attached.
Attachments: add_employee.cgi (0.90 KB)


Paul
Enthusiast

Jul 24, 2002, 2:07 AM

Post #5 of 5 (7175 views)
Re: [Troy] Cannont call method "prepare" on an undefined value at /home/cgi-bin/post_to_db.cgi [In reply to] Can't Post

Always use error checking :)

$dbh = DBI->connect($connectionInfo,$userid,$passwd) or die DBI->errstr;

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives