codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  help me  sanju_gates at 12:23 on Monday, October 22, 2007
 

#!/usr/bin/perl
use DBI;
use CGI qw(param);
$name1 = param("name");
$lover_name1=param("lover_name");
$per=int(rand(101));
$db="db";
$host='192.168.10.3';
$userid="sanjay";
$passwd="sanjay";
$connectionInfo="dbi:mysql:$db;$host";

# make connection to database
$dbh =

DBI->connect($connectionInfo,$userid,$passwd)

;

# prepare and execute query
$query = "SELECT * FROM cal WHERE $name =

$name1 AND $lover_name = $lover_name1";
$sth = $dbh->prepare($query);
$sth->execute();

# assign fields to variables
$sth->bind_columns(\$name, \$lover_name,

\$per);

# output name list to the browser

while($sth->fetch()) {
print "present";
}


$sth->finish();

# disconnect from database
$dbh->disconnect;
print "Content-type:text/html\n\n";
print "<HTML><HEAD>";

print "<TITLE>CGI Test</TITLE>";
print "</HEAD>";
print "<BODY><H2>percentage is $per</H2>";
print "</BODY></HTML>";


i am getting error as
DBD::mysql::st execute failed: You have an error in your SQL syntax near '= AND = ' at line 1 at ./luv2.pl line 19.

Statement has no result columns to bind (perhaps you need to successfully call execute first) at ./luv2.pl line 22.

kindly reply..











CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Chat application
•  How to send multiple perameters in SOAP request.
•  Java code for Insert picture on the table in spreadsheet
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime
•  help me
•  pls help me with this..
•  Re: Security - Code verify
•  Job @ EarlySail


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007