MySQL

Speeding up project using Zend_Db

<p>An existing project realized with the Zend Framework should be optimized in terms of performance. The use of Zend_Db slows down the database access because of its automatic table-scanning and overhead. The SQL-queries as well as the table structures are already optimized and should not be changed. The configuration on the server environment:</p><ul><li>PHP 5.2.6</li><li>MySQL Server Version: 5.0.75</li><li>Zend Framework 1.5</li><li>Apache 2.6.28-16</li><li>Suhosin-Patch 0.9.6.2</li></ul><p>The update to a newer version of Zend Framework is right now not possible because of some migration problems. The changes in the code should be measurable and viewable with XDEBUG/kcachegrind.</p>

Slow MySQL execution over Network under Java

If an application and the connected database is developed and tested on one single machine, code optimization and design of queries may suffer due to instant access time and nearly no transfer time between database and application. However, if you put the Application and Database on different machines such design flaws can lead to horrible processing times. There are several fields that may cause problems in that case. One problem is transferring of many records from or to database. Another problem is execution of hundreds of single independent SQL statements in a very short time, where the application always has to wait for response of database.

Howto implement a MySQL execution within JavaScript with Ajax

Step 1: Create the HttpRequest

function createXMLHttpRequest() {

var ua;

if(window.XMLHttpRequest) {
try {
ua = new XMLHttpRequest();
} catch(e) {
ua = false;
}
} else if(window.ActiveXObject) {
try {
ua = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
ua = false;
}
}
return ua;
}

Step 2: Create a function where you call your external MySQL
This function executes the file "abmelden.php" with the parameters "t_id" and "k_id".

function abmelden(teilnehmer, kurs) {
var req1 = createXMLHttpRequest();
req1.open('get', 'abmelden.php?t_id=' + teilnehmer + '&k_id=' + kurs);
req1.send(null);
}

Step 3: Write your MySQL-Script
Now just write down your MySQL-Query in the file "abmelden.php" and that's it.

mysql_query("DELETE FROM rechnung WHERE r_t_id ='".$_GET[t_id]."' and r_k_id ='".$_GET[k_id]."'");

You successfully executed your SQL-Query without reloading the page.
Ajax is really great ;)

Taggings:

How to execute MySQL Statements within JavaScripts with AJAX

Currently i am developing an administration software for a physiotherapy center. Therefor i simply use PHP and MySQL, so XAMPP was a very comfortable solution. As the complexety of the system grows i had to broaden my horizon and find some tricky solutions to achieve the surreal requirements of my employer. People always want everyhing "flexibel", fast, "automatically",... properties which are very hard to reach within a software. So someday i encountered a very hard problem which took me a long time to solve it (although, afterwards it wasn't so difficult). I had to process some data within my database, which was generated and accessed via JavaScript. If someone has programmed a little bit with PHP before, its not that hard to get content of a PHP-Variable within JavaScript, but its not so easy to process some JavaScript-Variables within an MySQL Statement without reloading the page. So a solution had to be found. After hours of internet surfing and talking to some programmers i found it, my holy grail, AJAX.

Use Dolphin on Mac OSX

Dolphin 6.1 from BoonEx is a community builder written in PHP and uses a MySQL database to store data. The main concept of Dolphin is to provide features that are used in social networks, such as building groups, share videos… Setting up Dolphin (on Mac OSX) is quite easy with the provided installation scripts (only some additional settings like for example permissions and additional graphical libraries are necessary). But still after a successful installation the system under Mac OSX doesn’t work perfect. The graphical operations are not executed correctly (and also some Ajax requests).

Cheap Yet Secure Daily Backups For Database And Files

I need to make backups of a webapplication's MySQL database and some files for a client. Backups should be done on a daily basis and the whole system should be as cheap as possible - "ok, backups are important, but I don't want to spend any money on it anyway...". The backup should be fully automated. Furthermore installing an FTP server on one of the client's local machines (to upload the backups there) is not wanted, due to security concerns. Generally nothing of the existing setup should be changed, if possible. Finally security is a major concern - the backups' content is sensitive so making the data publicly available is nearly as bad as losing it.

Pages

Subscribe to MySQL