|
|
Subject:
Update a remote MYSQL database using PHP
Category: Computers > Programming Asked by: mmatrix-ga List Price: $35.00 |
Posted:
22 Jun 2004 12:58 PDT
Expires: 23 Jun 2004 11:59 PDT Question ID: 364672 |
|
There is no answer at this time. |
|
Subject:
Re: Update a remote MYSQL database using PHP
From: crythias-ga on 22 Jun 2004 21:35 PDT |
You're so close! You know how to query a MySQL database from PHP with SELECT, so the connection to a database is the same. The query is simply "INSERT INTO tblname (col1, col2) VALUES (foosresult1, foosresult2);" from http://dev.mysql.com/doc/mysql/en/INSERT.html Of course, if you want *security*, then gpg encrypt the raw data, email it to BAR and let BAR gpg decrypt the raw data, run the PHP parser, including the INSERT to the MySQL on BAR. Since the data runs visible (hopefully only) on localhost of BAR, the exposure to the web is minimal. There's probably a better way, but I don't think parsing for clear text data and sending it is going to be secure. Do all of your data manipulation on the MySQL box. Yes, keep email separate, though. Maybe someone will have a different, perhaps better idea. |
Subject:
Re: Update a remote MYSQL database using PHP
From: crythias-ga on 23 Jun 2004 06:31 PDT |
I don't understand. As long as MySQL is hosting on TCP/IP (not UNIX Sockets only), $link = mysql_connect('BAR', 'mysql_user', 'mysql_password'); should work from FOO. For security, it appears you'll need openSSL and recompile MySQL with specific options. http://dev.mysql.com/doc/mysql/en/Secure_requirements.html |
Subject:
Re: Update a remote MYSQL database using PHP
From: mmatrix-ga on 23 Jun 2004 06:56 PDT |
Crythias, wouldn't the MySQL username and password be sent in cleartext uising that method? |
Subject:
Re: Update a remote MYSQL database using PHP
From: crythias-ga on 23 Jun 2004 11:27 PDT |
The short answer is "Yes" under PHP4 PHP5 gives mysqli including mysqli-ssl-set http://us4.php.net/manual/en/function.mysqli-ssl-set.php This for built-in PHP commands. HOWEVER, the http://us4.php.net/manual/en/function.shell-exec.php command might be useful to call the mysql CLI to connect under SSL and pass the query that way. (drop your query into a temporary file.sql, call the mysql -u and ssl connections, with reading in the inserts from file.sql. OK, OK, it's a kludge, but I don't know why it won't work. |
Subject:
Re: Update a remote MYSQL database using PHP
From: mmatrix-ga on 23 Jun 2004 11:58 PDT |
That is very interesting, if I can connect via SSl to "Bar" from "Foo" then I can execute my INSERT query securely. Thanks! |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |