Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Delphi and phpmyadmin? (https://www.delphipraxis.net/73382-delphi-phpmyadmin.html)

pastra 17. Jul 2006 12:46


Delphi and phpmyadmin?
 
Hi!

I was wondering: How can I create a function i delphi to:

-Connect to my: phpmyadmin
-Enter my password and username
-loop all records in a speciffic table to see if my ip is allready in the table (If not then ADD)
-Delete by uniqe ID function


Is it posible from delphi?


If so, it need to bee as small as posible...


I look forward to hear some great idears on how to acomplise this.. ( or just a few hints :P )


Thanks in advance!


Cheers!

Phoenix 17. Jul 2006 12:55

Re: Delphi and phpmyadmin?
 
Hi,

well.. look at the Indy components. The Idhttp component should be able to do all what you want.
In short, it is to build the initial http - Request to get the login-form from the server, then you can fill out the controls (username, password) and send a login-request. After that you need to put all the steps you would manually do in myphpadmin into code handling the answers from the idhttp component.

I guess we have some hints here in the forum, but I fear all in german.

3_of_8 17. Jul 2006 12:55

Re: Delphi and phpmyadmin?
 
Yes, it is. Take a look at the Indy Components. (Google helps)

But this is a long way round, so you should either try to connect directly to the database or you use a simple PHP Script with GET-parameters to do what you want to do.

pastra 17. Jul 2006 12:59

Re: Delphi and phpmyadmin?
 
Zitat:

Zitat von 3_of_8
Yes, it is. Take a look at the Indy Components. (Google helps)

But this is a long way round, so you should either try to connect directly to the database or you use a simple PHP Script with GET-parameters to do what you want to do.


how would i start out if I would like to try: "to connect directly to the database" ?


I guess my last post was miswritten, becous I do not want to connect to the phpmyadmin.. I only want to be albe to post data (insert delete set) in a table created BY phpmyadmin..


The Get/post with idhhtp I would rather awoid...


Is it posible to use some sql components or???


Thanks!

3_of_8 17. Jul 2006 13:03

Re: Delphi and phpmyadmin?
 
It does not matter anyway how you did create those tables.

Well, at first you have to find out whether your database hoster supports direct connections to the database. If yes, you can use MySQL-Components you first have to find. (But there are several.)

Apart from that, there's no real possibility to establish a connection without those tricks like a PHP script or ASP and so on.

Phoenix 17. Jul 2006 13:07

Re: Delphi and phpmyadmin?
 
That depends...

first of all, you need to check if you have remote access to that database at all (I guess it's mysql, right?). Most providers deny direct access to a hosted database from other computers than the webserver, that is for security reasons.

Have a google for MySQL Front. It's commercial software, but you can get a free trial version with which you can test remote access to that database. Try to connect to that database with mysql front, if you can connect, and if you can do the desired operations through mysql front, then the next step is to build that in your application. If you don't have remote access at all (perhaps contacting your provider could also help), your stuck with this possibility and need to use php to gain database access.

If you get a connection, have a look at the ZEOS components for direct database access.

pastra 17. Jul 2006 13:08

Re: Delphi and phpmyadmin?
 
Zitat:

Zitat von 3_of_8
It does not matter anyway how you did create those tables.

Well, at first you have to find out whether your database hoster supports direct connections to the database. If yes, you can use MySQL-Components you first have to find. (But there are several.)

Apart from that, there's no real possibility to establish a connection without those tricks like a PHP script or ASP and so on.


Okay, thank you for your fast reply, I will first try to find a MySQL-Component and see if It is posible for me to use that, second I'll try to set up an .asp page witch i can use idhttp to post to...


Thanks to ALL for there reply's


Cheers!

r2c2 17. Jul 2006 13:59

Re: Delphi and phpmyadmin?
 
Zitat:

Zitat von pastra
Okay, thank you for your fast reply, I will first try to find a MySQL-Component and see if It is posible for me to use that, second I'll try to set up an .asp page witch i can use idhttp to post to...

I would soggest another order:
1. download MySQL-QueryBrowser or MySQL-Administrator or another frontend of your choice
2. Try to connect with one of those programs
3a. if you can connect, you're lucky(not Luckie :mrgreen:) --> look for some DB-Components
3b. if you are not able to connect, you have to build up a kind of repeater-file in PHP or ASP or whatever your provoder supports --> send the query to the repeater-file which sends it to the database. The problem here could be security. You have to implement an authorization in order not to allow everybody to access your db.


Christian


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:12 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