AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Projekte MySQL via PHP-Tunnel (über eigene libmysql.dll)
Thema durchsuchen
Ansicht
Themen-Optionen

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

Ein Thema von omata · begonnen am 22. Feb 2010 · letzter Beitrag vom 25. Mai 2015
Antwort Antwort
Seite 10 von 10   « Erste     8910   
omata
Registriert seit: 26. Aug 2004
Dieses Projekt ermöglicht den Zugriff auf eine MySQL-Datenbank über ein PHP-Skript.

Dabei werden folgende Punkte untersützt:
  • Lesender Zugriff
  • Schreibender Zugriff
  • Transactionsteuerung
  • Auslesen von Systeminformationen
  • Funktioniert auch im Designmodus von Delphi
  • Stellt den Zugriff über TDataset zur Verfügung, damit können alle normalen Datenbankkomponenten verwendet werden
Miniaturansicht angehängter Grafiken
phptunnel.png  
Angehängte Dateien
Dateityp: zip SQLTunnel.zip (1,41 MB, 301x aufgerufen)
Dateityp: rar SQLTunnel_src.rar (4,48 MB, 217x aufgerufen)

Geändert von omata (14. Aug 2011 um 19:27 Uhr)
 
Benutzerbild von Sir Rufo
Sir Rufo

 
Delphi 10 Seattle Enterprise
 
#91
  Alt 25. Mai 2015, 11:46
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 '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
  Mit Zitat antworten Zitat
teosuper
 
#92
  Alt 25. Mai 2015, 11:58
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.
Teo
  Mit Zitat antworten Zitat
sippytom
 
#93
  Alt 25. Mai 2015, 12:42
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?

Tom
  Mit Zitat antworten Zitat
teosuper
 
#94
  Alt 25. Mai 2015, 12:46
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.
Teo
  Mit Zitat antworten Zitat
sippytom
 
#95
  Alt 25. Mai 2015, 12:54
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
  Mit Zitat antworten Zitat
teosuper
 
#96
  Alt 25. Mai 2015, 13:04
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..
Teo

Geändert von teosuper (25. Mai 2015 um 13:11 Uhr)
  Mit Zitat antworten Zitat
sippytom
 
#97
  Alt 25. Mai 2015, 13:10
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

Geändert von sippytom (25. Mai 2015 um 13:14 Uhr)
  Mit Zitat antworten Zitat
teosuper
 
#98
  Alt 25. Mai 2015, 13:26
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.
Teo
  Mit Zitat antworten Zitat
sippytom
 
#99
  Alt 25. Mai 2015, 13:44
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
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 10 von 10   « Erste     8910   


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:25 Uhr.
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