× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ladies and Gentlemen:

We have a customer that's trying to do a prepared statement to create a DB2 record on their Midrange box, and one of the fields they're attempting to populate is a rather long VARLEN character field (EBCDIC, max length a little under 16k), with embedded line breaks.

I have very little experience with Prepared Statements, and none whatsoever with PHP. Here's a simplified fragment of what they have (and assume all variables have already been populated):

$nrecid = $accaid; // Record ID ( Passed from earlier in the function )
$temp = "Name: " . $name . "
Email Address: " . $emailAddress . "
Phone Number: " . $phoneNumber . "
Message: " . $message . "
HTTP_REFERRER: " . $_SERVER[ 'HTTP_REFERER' ]; // Notes
$nnotes = str_replace( " ", "", $temp );

$args = array(
$nrecid ,
$nnotes );

$query = "INSERT INTO " . $library . ".NOTEFILE
( NRECID, NNOTES )
VALUES ( ?, ? )";
$stmt = db2_prepare( $conn, $query );

if ( !db2_execute( $stmt, $args ) ) {
$error = array (
'Statement Error' =>db2_stmt_error( ),
'Error Message' => db2_stmt_errormsg( ),
'Query' => aiInterpolateQuery( $query, $args )
);

++$errorCount;
}

It looks like he's trying to use line breaks in the code to produce line breaks in the value of $nnotes. Is that even possible?

What we actually WANT to show up in the EBCDIC value of the NNOTES field is a Hex'0A' for each line break.

--
JHHL

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.