Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: New CGI Action Call

by tultalk (Monk)
on Mar 25, 2018 at 15:37 UTC ( [id://1211696]=note: print w/replies, xml ) Need Help??


in reply to New CGI Action Call

Perhaps "@values" belongs in execute

$sth->execute(@values) or die "Unable to execute query: " . $sth->err +str;

Replies are listed 'Best First'.
Re^2: New CGI Action Call
by tultalk (Monk) on Mar 25, 2018 at 15:53 UTC

    That got past the NULL hump

    [Sun Mar 25 10:45:52 2018] update_tables.cgi: DBD::mysql::st execute f +ailed: You have an error in your SQL syntax; check the manual that co +rresponds to your MySQL server version for the right syntax to use ne +ar 'table SET business = 'Jackson Group',forename = 'Louis',lastname += 'Jackson',pas' at line 1 at update_tables.cgi line 664.

    pas is part of password = 'ZZZZZZZZ' and 2 other fields missing from the 6 I changed.

      And the call from the darkness

      <- dbd_st_free_result_sets <-- dbd_st_finish <- DESTROY= undef at update_tables.cgi line 662 via at update_tab +les.cgi line 662 -> execute for DBD::mysql::st (DBI::st=HASH(0x2bbb330)~0x2bbddd8 ' +Jackson Group' 'Louis' 'Jackson' 'ZZZZZZxxxxxxxx' 'CCCCCCCC' '3' 23) +thr#1e97010 Called: dbd_bind_ph Called: dbd_bind_ph Called: dbd_bind_ph Called: dbd_bind_ph Called: dbd_bind_ph Called: dbd_bind_ph Called: dbd_bind_ph -> dbd_st_execute for 2bbd898 >- dbd_st_free_result_sets <- dbd_st_free_result_sets RC -1 <- dbd_st_free_result_sets mysql_st_internal_execute MYSQL_VERSION_ID 50558 >parse_params statement UPDATE table SET business = ?,forename = ?,las +tname = ?,password = ?,pin = ?,position = ? WHERE user_id = ? Binding parameters: UPDATE table SET business = 'Jackson Group',forena +me = 'Louis',lastname = 'Jackson',password = 'ZZZZZZxxxxxxxx',pin = ' +CCCCCCCC',position = '3' WHERE user_id = '23' --> do_error You have an error in your SQL syntax; check the manual that correspond +s to your MySQL server version for the right syntax to use near 'tabl +e SET business = 'Jackson Group',forename = 'Louis',lastname = 'Jacks +on',pas' at line 1 error 1064 recorded: You have an error in your SQL + syntax; check the manual that corresponds to your MySQL server versi +on for the right syntax to use near 'table SET business = 'Jackson Gr +oup',forename = 'Louis',lastname = 'Jackson',pas' at line 1

      Looks like the dynamically created SQL statement is correct

      Why it is chopped off??Who knows

        UPDATE table SET business = ? .. ^^^^^ this should be the table name users

        If you add RaiseError=>1 to your connect statement like this

        my $dbh = DBI->connect($dsn, $user, $pw, { RaiseError=>1 } );

        you don't need all those or die statements

        or die "Error Preparing:\n" . $stmt . "\nDBI returned: \n", $dbh->errs +tr; .. or die "Unable to execute query: " . $sth->errstr;
        poj

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1211696]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-03-29 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found