in reply to DBI UPDATE statement failing

$sthUpdateBandwidth->execute($data[0], $newbw)
Shouldn't that be
$sthUpdateBandwidth->execute($newbw, $data[0])
instead?

Also, if you really want to use LIKE, you should put the value to be searched inside of %, so it will do a "LIKE '%foo%'" search.

Replies are listed 'Best First'.
Re: Re: DBI UPDATE statement failing
by Merlin83 (Novice) on Dec 14, 2001 at 23:36 UTC
    Yep, as andye has pointed out, I had the parameters the wrong way round. In this use of LIKE, I'm simply using to to remove case-sensitivity, not for wildcard use.
      It's usually faster and more obvious to do case-insensitivity by converting both to lowercase. You can use lc() in perl and lower() in most SQL databases. If you do this all the time and it performs badly, you might want to investigate building an index for the lowercased version of the column.