in reply to Re: Re: Re: Re: Re: Right answer (wrong question...)
in thread Right answer (wrong question...)

Hi Jarich,

Like this??

# MySQL my $insert; if ($entry_order eq '1') { } $insert = "INSERT INTO `mysql_db` (`Title`, `Email`, `City`, `State`, `Country`, `URL`, `Date`, `Description`, `rid`, `dt_create`, `publish`, ) VALUES ("; } if ($line_breaks == 1) { $FORM{'Title'} =~ s/\cM\n/\n/g; } $insert .= "$FORM{'Title'}"; $insert .= ", "; if ( $FORM{'Email'} ){ my $email_name = $dbh->quote($FORM{'Email'}); # if ($linkmail eq '1') { $insert .= $email_name; # } # else { # $insert .= "$FORM{'Email'}"; # } $insert .= ", "; } if ( $FORM{'City'} ){ $insert .= "$FORM{'City'}"; } { $insert .= ", "; } if ( $FORM{'State'} ){ $insert .= "$FORM{'State'}"; } { $insert .= ", "; } if ( $FORM{'Country'} ){ $insert .= "$FORM{'Country'}"; } { $insert .= ", "; } if ($FORM{'URL'}) { $insert .= "$FORM{'URL'}"; } else { $insert .= "$FORM{'URL'}"; } { $insert .= ", "; } if ($separator eq '1') { $insert .= "'$date'"; } else { $insert .= "'$date'"; } { $insert .= ", "; } if ( $FORM{'Description'} ){ $insert .= "$FORM{'Description'}, '', NOW(), 0)"; } else { $insert .= $_; } $sth=$dbh->prepare($insert); $sth->execute(); } $dbh->disconnect();
Thanks,

-Bob

bobafifi.com

Replies are listed 'Best First'.
need more info
by MCS (Monk) on Feb 25, 2004 at 15:18 UTC

    What kind of errors? Please read How (Not) To Ask A Question. It will help us be able to help you better.

    Also is there any reason you are tied to this script? Others have suggested it and I will reiterate, have you looked at nms? I hate to say this to you but I am not going to spend much more time trying to help you with this script as I feel it is bad and insecure code. If you decide to use nms or write your own I would be more than welcome to help you but, you first need to read How (Not) To Ask A Question and do what it suggests. You started out with too little information and you didn't include any errors... not a good thing to do. Do some reading and then come back enlightened.

      Hi MCS,

      The "500 Internal Server Error" message I get is:
      Internal Server Error The server encountered an internal error or misconfiguration and was u +nable to complete your request. Please contact the server administrator, webmaster@usedflutes.com and +inform them of the time the error occurred, and anything you might ha +ve done that may have caused the error. More information about this error may be available in the server error + log.


      I have tried to articulate the problem as best as I can in modifying Matt Wright's well known (and replicable...) "Guestbook" script.

      That CountZero's code "works" (i.e., the script runs fine and posts an INSERT string to MySQL) while other attempts to modify the script since have not is all I know, sorry.

      Thanks anyway.

      -Bob

      bobafifi.com