Delphi-PRAXiS
Seite 10 von 10   « Erste     8910   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Software-Projekte der Mitglieder (https://www.delphipraxis.net/26-software-projekte-der-mitglieder/)
-   -   MySQL via PHP-Tunnel (über eigene libmysql.dll) (https://www.delphipraxis.net/148076-mysql-via-php-tunnel-ueber-eigene-libmysql-dll.html)

Sir Rufo 25. Mai 2015 11:46

AW: MySQL via PHP-Tunnel (über eigene libmysql.dll)
 
Zitat:

Zitat von teosuper (Beitrag 1302919)
The answer is not complete. I agree to the quotes but the assignment ":=" is Pascal, not SQL. So you have to change that to "=".

Sorry.. Neither English nor German so I forgot what the ":" is called :-) Good luck!

If you agree to the double quotes why do you claim anything inside the string value
Delphi-Quellcode:
'AA:=1234; bbA'
to be Pascal or SQL? It is just a string and can contain anything you like and will not be handled by Pascal or SQL. It is just a value

teosuper 25. Mai 2015 11:58

AW: MySQL via PHP-Tunnel (über eigene libmysql.dll)
 
Ja, stimmt schon.. Nicht gut hingeschaut..

Indeed.. the whole part in quotes is inserted in a field in the database so the Pascal ":=" does not matter nor affect anything.

sippytom 25. Mai 2015 12:42

AW: MySQL via PHP-Tunnel (über eigene libmysql.dll)
 
Just did some tests and still got the error
Code:
DROP TABLE IF EXISTS nodes;
CREATE TABLE nodes (
  node_id int,
  parent_id int,
  bez TEXT,
  CONSTRAINT PK_nodes PRIMARY KEY (node_id),
  CONSTRAINT FK_nodes_parent FOREIGN KEY (parent_id) REFERENCES nodes (node_id)
) ENGINE=InnoDB;

INSERT INTO nodes VALUES (1, NULL, 'A');
INSERT INTO nodes VALUES (2, 1, 'AA');
INSERT INTO nodes VALUES (3, NULL, 'B');
INSERT INTO nodes VALUES (4, 2, "AA=1234; bbA");
Still have error on the bottom line.
So not everything enclosed in quotes is passed as a string? :oops:

Tom

teosuper 25. Mai 2015 12:46

AW: MySQL via PHP-Tunnel (über eigene libmysql.dll)
 
Hello Tom,

MySQL will not accept double quotes I guess. The double quotes are only valid from within Delphi.
Your SQL statement should work if you quote the string in the last line just like the others.

sippytom 25. Mai 2015 12:54

AW: MySQL via PHP-Tunnel (über eigene libmysql.dll)
 
Hi,

Single quotes is how I had it before. Still with the error.
Maybe it has something to do with the transfer of data between zeos and the tunnel php file.

Tom

teosuper 25. Mai 2015 13:04

AW: MySQL via PHP-Tunnel (über eigene libmysql.dll)
 
I executed this in Heidisql without errors:

DROP TABLE IF EXISTS nodes;
CREATE TABLE nodes (
node_id int,
parent_id int,
bez TEXT,
CONSTRAINT PK_nodes PRIMARY KEY (node_id),
CONSTRAINT FK_nodes_parent FOREIGN KEY (parent_id) REFERENCES nodes (node_id)
) ENGINE=InnoDB;

INSERT INTO nodes VALUES (1, NULL, 'A');
INSERT INTO nodes VALUES (2, 1, 'AA');
INSERT INTO nodes VALUES (3, NULL, 'B');
INSERT INTO nodes VALUES (4, 2, 'AA=1234; bbA');

Maybe very stupid question but if the sql I post does not work for you, what happens if you replace the ";"? That could very well be a delimiter in the PHP tunnel..

sippytom 25. Mai 2015 13:10

AW: MySQL via PHP-Tunnel (über eigene libmysql.dll)
 
I am using an sql tunnel demo from the 1st post.
I just need a way to connect to a mysql database using tunneling.
I have not done a check but is Heidisql a sql tunnel?

I am using Delphi 7

teosuper 25. Mai 2015 13:26

AW: MySQL via PHP-Tunnel (über eigene libmysql.dll)
 
HeidiSql is a tool like phpMyadmin.

I have a few general suggestions: first is to replace the ";" with some different character. If that works, at least you know what the issue is.

A quick work around: if you use stringreplace to replace ";" when posting and another stringreplace when retrieving the data, your problem should be worked around.

sippytom 25. Mai 2015 13:44

AW: MySQL via PHP-Tunnel (über eigene libmysql.dll)
 
Thanks, yes I think I will test various characters that I can set on the way to the database and reset on the way out.

Tom


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:33 Uhr.
Seite 10 von 10   « Erste     8910   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz