in reply to mysql update table how to
this the error i am getting: 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 '<> 'Yes'' at line 6 at admin.pl line 2316.
this is the code i am using
use strict; use warnings; use DBI; my $userid = DB::trim( param('Userid') ); # ?? my $username = DB::trim( param('Username') ); my $password = DB::trim( param('Password') ); my $DISABLED = ucfirst ( DB::trim( param('Disabled') ) || '' ); $DISABLED = 'No' unless $DISABLED eq 'Yes'; my $sql = 'SELECT ID,Disabled FROM EmployerJobs WHERE Username = ? AND Password = ? AND USERID = ? AND Disabled = <> ?'; my $dbh = DB::connect(); my $tbl_info = DB::TableInfo->get ($dbh, "EmployerJobs"); my $sth = $dbh->prepare($sql); $sth->execute($username, $password, $userid, $DISABLED); while ( my $row = $sth->fetchrow_hashref() ){ param (-name => "Disabled", -value => $DISABLED); param (-name => "ID", -value => $row->{ID}); $tbl_info->update_record ($dbh, "ID"); #print "Content-Type: text/html\n\n"; #printf "Updated ID '%s' from '%s' to '%s'\n",$row->{ID},$row->{DISA +BLED},$DISABLED; };
Any help would be greatly appreciated, Thanks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: mysql update table how to
by huck (Prior) on Mar 19, 2019 at 02:42 UTC | |
by VC (Novice) on Mar 19, 2019 at 16:29 UTC | |
by hippo (Archbishop) on Mar 19, 2019 at 16:32 UTC | |
by VC (Novice) on Mar 19, 2019 at 16:02 UTC | |
by VC (Novice) on Mar 19, 2019 at 16:04 UTC | |
by VC (Novice) on Mar 19, 2019 at 19:31 UTC | |
by choroba (Cardinal) on Mar 19, 2019 at 19:51 UTC | |
by huck (Prior) on Mar 19, 2019 at 19:52 UTC | |
by VC (Novice) on Mar 20, 2019 at 16:56 UTC | |
|