Don wrote:
> 
> Hi,
> 
> I'm looking at the docs for the UPDATE syntax right now!
> 
> Here is my code (in Perl):
> 
> $sqlCmd = $dbh->prepare("UPDATE Ports SET Country   = $country,
>                                           TransPort = $transPort,
>                                           Suspended = $suspended,
>                                           Transit   = $transit,
>                                           Tranship  = $tranship,
>                                           CargoDisp = $disposition
>                          WHERE PortName = $port");
> 
> When I issue an: $sqlCmd->execute() or die "Can't execute statement:
> $DBI::errstr";
> 
> I get the following error message:
> 
> DBD::mysql::st execute failed: Unknown column 'GERMANY' in 'field list'
> at myprog.pl line 164.  Can't execute statement: Unknown column
> 'GERMANY' in 'field list' at myprog.pl
> line 164.
> 
> Ports is my table.  "GERMANY" is actually the contents of the scaler
> array $country, so why is it giving me an unknown column error?
> 
> Thanks,
> Don
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Try single quoting the scalar eg ("UPDATE Ports SET Country   =
'$country', etc etc")

Stuart
---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to