in reply to Mysql syntax error from DBI
Since "drain cleaner" is two words, it should be quoted. An easy way to solve this and similar problems is to use placeholders. Something like:
should do the trick. The question marks are replaced by the values passed to execute. For more information, see DBI.my $sth =$dbh ->prepare("UPDATE products set pname=? and unit=? and q +ty=? and cost=? WHERE id = ?"); $sth->execute($pname, $unit, $qty, $cost, $id);
Are you sure it was a book? Are you sure it wasn't.....nothing?
|Replies are listed 'Best First'.|
Re: Re: Mysql syntax error
by dbwiz (Curate) on Nov 10, 2003 at 19:00 UTC
In Section Seekers of Perl Wisdom