Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
What I'm looking is to execute a script as soon as there is an INSERT on one of the MYSQL table.
I wanted to export all the contents of the inserted row into formatted Excel file. (This will be done through external script written in PHP)
Main issue is to call the script as soon as the insert occurs.
First thing that occurred to me is to create a Trigger and call the script (Found that this is not best approach. Other thing occurred to me is running a crontab
Could anyone please suggest if there is a better solution for this?
PS: The INSERT happens through an external application and I have no control over it.
This question was answered here: Invoking a PHP script from a MySQL trigger btw.
Anyway, other possible solution is to create environment with replication (although there will be no slave), write your own mysql client connected to the master (simulating slave server) and waiting for commands comming through.
You can also create "tail -f" script listening on binlog file.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I'm developing an application composed of two elements: a simple PHP server interacting with a SQL DB and a client which on certain events will send information to the server to log.
I would like a way to somehow verify (on the server's side) that the incoming query is indeed coming from my client, because there is a possibilty that someone will decompile the client file and see how I connect and send commands to the server, and that would let them inject false data.
I have no idea how to do such a mechanism though simply because anything I implement in the client could (theoretically) be viewed after decompilation process. Or maybe obfuscation is a solution in this case?
If someone is intrepid enough to decompile your client, they will simply write their own client using your mechanism and there's no way you can distinguish the two. No amount of "authentication" will stop that. (Like for example, if someone gets my private SSH key, game over: they are me until those keys are revoked.)
The best you can do is make it hard for them to decompile, detect intrusion, and limit damage. Some ideas, but you really should consider the attack patterns you expect to face:
Only allow the client to execute certain commands with certain parameters
Do not allow any more than the expected number of commands per time period
Limit the IP from which those certain commands can come
Be able to revoke client privileges on the server
PS: Expect this question to be closed or at least downvoted. It's not about code, but about design.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
In my project simply I want to run local application as netbeans or word document installed in my computer on click of a link? Is it possible ? If yes how am I to do it? If no why it's not possible.
Thanks in advance.
You can link to a PHP script and then in this script use exec() to run your application.
<?php
exec('path/to/your/app.exe -possibleparam -param2');
/* EOF */
I don't know if it is that what you are looking for:
http://www.php.net/manual/en/function.exec.php
exec will execute the app in the machine where the php is installed (so your server).
If you mean that the php should open an app on the user pc while he's surfing on your site, no.
The only way to to this is an NPAPI plugin. And use Javascript, not PHP.
PHP runs on the server. It has no control over the client. This is by design. If web pages could run programs on the client computer then it would be abused to an unlimited degree, for spam, viruses, and junk.
You can use the exec function to run a program on the server. If your server and client happen to be running on the same local computer, then this will do what you want.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Am currently working on a website(html 5) that calculate the expenses for the user, after the calculation, user has to save it as report for future purposes. So i wanna know if there is anyway to connect my website(html5) to database using phpadmin.
thankyou
html5 doesn't connect to SQL (phpmyadmin), but php does :)
html5 is for delivering static documents. To do things such as connecting to databases, you need a server side language like php.
html5 generally means javascript and modern html features. Neither of these things have anything to do with PHP. However, you can write php inside your html5 web page, and connect to a database from there.
How exactly you would go about doing this depends on what OS you are running, but if you want to start using php and SQL together with phpmyadmin, you'll need to setup an apache server, and install php and mysql.
A full tutorial on it is out of the scope of a stack overflow post, but I suggest researching LAMP, XAMPP, and WAMP keywords. By installing these, depending on your operating system, you should be able to start connecting php scripts with mysql and using phpmyadmin to simplify the process.
There are plenty tutorials on getting php up and running with databases, just use google.
Good luck :)
Maybe these will be helpful:
http://community.linuxmint.com/tutorial/view/486 (for linux)
http://www.w3schools.com/php/php_mysql_intro.asp (once you get started)
HTML5 is just a static document, You cannot access a server-side databases from a web browser without server side scripts.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am newbie to programming. But I am going to work on a website that will have millions of records and huge traffic and I want to load balance my database of application server.
How can I create an application in PHP? and how can I distribute a single database on to multiple servers?
You should check out Hadoop. That is a very fine example of a distributed database system.
http://hadoop.apache.org/
I don't think you'll get a detailed explanation here, as that kind of thing is quite complex. You may want to check out MySQL Cluster.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have downloaded WAMP to try to learn PHP on, and am having trouble getting it to work as expected whenever trying to follow along in PHP tutorials.
Either what I get back in my browser is raw PHP (as shown below in "PHP Test 1"), or nothing at all (as shown below in "PHP Test 2"). I'm just trying to learn the basics of PHP, and am finding this to be very frustrating. Can anyone help? What do I need to do get PHP working, or what should I try?
Originally I was going to post screen shots to better describe the problem I'm having, as well as to better help others who are experiencing the same problem, but was not allowed to due to something about not having enough "points". Anyway, what I was originally trying to post can be found here:
https://sites.google.com/site/bluedog4678/
You need to start WAMPP then type this in the address bar: localhost/PHP_TEST_1.php.
You are currently opening a simple file without running WAMPP you need to run it through localhost.
You shouldn't access your files directly. Normally with simulated apache-servers you need to type in "localhost" to let it render correctly
EDIT
If you want to select a file it would be "localhost/"