Quoting sam wun <[EMAIL PROTECTED]>: > HI, > > the following insert/update produced error. I m using MySQL 5.0. > $insert_sql = qq {insert into inventory > (prodcode,qty,lastupdatedate,prodname,basename,vendorname,cost) > values (?,?,?,?,?,?,?) ON DUPLICATE KEY > UPDATE > > qty=$qty,lastupdatedate=$date,prodname=$prodname,basename=$basename, > vendorname=$vendorname,cost=$cost;}; > $sth = $dbh->prepare($insert_sql) || die "prepare: $insert_sql: > $DBI::errstr"; > > $sth->execute($prodcode,$qty,$date,$prodname,$basename,$vendor,$value) > || die "Unable to execute query: $dbh->errstr\n"; > > Error: > DBD::mysql::st execute failed: You have an error in your SQL syntax; > check the manual that corresponds to your MySQL server version for the > right syntax to use near 'abc4_93419_06888,basename=Revlon, vendorname=,cost=' at line 3 at insert-inventory-mysql.pl line 55,
Try using single quotes where vendorname='',cost=''... > <INVS_FH> line 1. > Unable to execute query: DBI::db=HASH(0x864a988)->errstr > > Thanks > Sam > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > > R. Whitney Transcend Development "Producing the next phase of your internet presence" http://xend.net Premium Quality Web Hosting http://xendhosting.com rw AT xend.net Net Binder http://netbinder.net 310-943-6498 602-288-5340 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]