Hi all,

Still struggling with this new MySQL installation, having problems again...
MySQL 4.1 has much more character set options than 3.23, but this also
generates some confusion:

Both in Delphi and in PHP appplications I used to have blocks of statements
like this:

BEGIN;
STATEMENT 1;
STATEMENT 2;
COMMIT;

In PHP I tended to put "\r\n" behind each statement for debugging purposes:

$Queryblock  = "begin;\r\n";
$Queryblock .= "statement1;\r\n";
$Queryblock .= "statement2;\r\n";
$Queryblock .= "commit;";
if ($Debug) [echo$Queryblock;} else {$Result = get_data($Queryblock;}

Where of course get_data($Query) is a function that connects to the DB,
submits the query, and retrieves the result in an array.

In Delphi things go in a similar way, the component that communicates with
the DB uses a "TStringList" in which you put the statements and the contents
of this TStringList are submitted to the DB server.

Now MySQL 4.1, unlike the previous version, throuws an error on this, for
some reason it 'sees' the control characters (newline), leaves these in the
statements and thus the statements are not executed., as there is something
invalidating the statement after the ";" and before the next real
statemenent.

In PHP applications this was easy to solve: no more 'newline' characters. A
bit less readable in debugging (but solveable by doing a str_replace(";",
";\r\n", $Queryblock) but no problem.
However, In Delphi I have no way to keep the newlines out of the blocks of
statements, as I have no say in how the TStringList ( a datatype) is coded
and what is used to separate lines.
Thus I do not get any multiple statements executed in my Delphi applications
anymore.

Something tells me MySQL should be instructed to use the correct character
set to eliminate this problem, but how do I do this? I already tried sending
"SET NAMES ASCII" and "SET NAMES UTF8" commands directly after establishing
a connection but with no result.

So regular expressions like "\r\n" are what characterset exactly? Tell MySQL
it is receiving *what* to make it filter this out of the blob of data that
Delphi is throwing at it to prevent this poisoning my statements?

Any thoughts on this appreciated.

Marc



Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to