473,406 Members | 2,369 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,406 software developers and data experts.

perl sql insert into not working please help

why this code is not working please help. thanks
Expand|Select|Wrap|Line Numbers
  1. my $count = 0;
  2. $count = $dbh->do("INSERT INTO ques (username,userque,userquedetail,userquecatgory,userresponsecount,quegood,quebad,queid,userquedate,quevideo,queaudio,quepic,email)values(?,?,?,?,?,?,?,?,?,?,?,?,?)", 
  3. undef,$usernamenow,$txtque,$txtdetail,$cat,$userresponsecount,$quegood,$quebad,$queid,$userquedate,$txtvideolink,$txtaudiolink,$txtpicturelink,$txtemail);
Jan 25 '08 #1
1 1821
eWish
971 Expert 512MB
Welcome to TSDN!

What errors do you get? When using placeholders you have to have equal number of placeholders as values. It appears that you are passing more values that it is expecting. For me, this convention is more readable.

Expand|Select|Wrap|Line Numbers
  1. my $insert = $dbh->prepare(q{INSERT INTO table (column1, column2) VALUES(?,?)});
  2.    $insert->execute($value1, $value2);
  3.    $insert->finish();                
  4.  
--Kevin
Jan 25 '08 #2

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

Similar topics

3
by: Jeanne | last post by:
I am working on a cgi script that is suppose to pop-up a javascript box from the following perl variables:$TodayDate, $LinkCity, $LinkState. I recently encountered a problem with the $LinkCity...
4
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
0
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile....
2
by: Marty Meyers | last post by:
I have the following line in a php file: $msg= exec("perl $scriptPath/insert.pl $d $u $t 2>&1", $returnVal); Can someone explain the "2>&1" argument? Second problem, this same line of code...
1
by: newhaven_lad | last post by:
Please could someone help, I have a Perl cgi script which works perfectly when run in a dos prompt, it connects to a database on my laptop and inserts a record. But when I use the internet browser...
2
josie23
by: josie23 | last post by:
Egad, I'm not a coder/programmer by nature or occupation but understand things like html and css and a small amount of perl. So, basically, I'm a perl/mysql imbecile. But, I've been trying to...
3
by: kokul | last post by:
Hi friends, I want to take a description (atleast 50 characters) from the html page using cgi->param and store it into a string variable in perl and pass this string variable to a query. for...
9
by: idorjee | last post by:
Hi guys, I have a small problem with my Perl-CGI script, and I would appreciate if anyone can help me out with this. I'm trying to get this done in two stages. 1st to get a bunch of info from the...
6
by: spider661 | last post by:
im trying to make a perl file that will take all the info from a spell_us.txt file and place it into an sql file i can import into my database but its not working can anyone help please? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.