chriso has asked for the wisdom of the Perl Monks concerning the following question:
DBD::mysql::st execute failed: You have an error in your SQL syntax near 'cleaner and unit=cn and qty=15 and cost=1.35 WHERE id = 19' at line 1
Here is the code
my $sth =$dbh ->prepare ("UPDATE products set pname=$pname and unit=$ +unit and qty=$qty and cost=$cost WHERE id = $pid");
pname should be "drain cleaner", unit should be "cn", qty should be 15, and cost should be 1.35. Thanks. Chris. Never mind, I figured it out.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mysql syntax error
by meetraz (Hermit) on Nov 10, 2003 at 18:44 UTC | |
|
Re: Mysql syntax error
by batkins (Chaplain) on Nov 10, 2003 at 18:18 UTC | |
by dbwiz (Curate) on Nov 10, 2003 at 19:00 UTC | |
|
Re: Mysql syntax error
by talexb (Chancellor) on Nov 10, 2003 at 19:29 UTC |