Skip to main content

Posts

How to check your database size

SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB", sum( data_free )/ 1024 / 1024 "Free Space in MB" FROM information_schema.TABLES GROUP BY table_schema ; Ref: http://forums.mysql.com/read.php?108,201578,201578

Javascript / JQuery / ExtJS / OOJS

Javascript OOP Inheritance <script> function Parenizor(value) { this.setValue = function (value) { this.value = value; return this; }; this.getValue = function () { return this.value; }; this.toString = function () { return '(' + this.getValue() + ')'; }; this.setValue(value); } function child() { this.toString = function () { return ' - ' + this.getValue() + ' - '; }; } child.prototype = new Parenizor("RamTest"); ch = new child(); console.log(ch.toString()); ch.setValue("RamTest Modified"); console.log(ch.getValue()); </script> How to check Cookies are enabled or not in JS <script> if(navigator.cookieEnabled) { alert('enabled') } </script> Javascript Closures To create a closure, you nest a function inside of a function. That inner function has access to all variables in its parent function’s scope. This comes in handy when creating methods and properties in object oriente...

PHP MYSQL questions from external forum

How to check is javascript enabled or not in your browser using PHP $results = get_browser(); if ($results["javascript"] == 1) { echo "You have javascript"; } PHP MySQL Interview Questions and Answers What’s PHP The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. What Is a Session? A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests. There is only one session object available to your PHP scripts at any time. Data saved to the session by a script can be retrieved by the same script or another script when requested from the same visitor. Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor. What is meant by PEAR in php? Answer1:...

Creating a simple Blog System – Part 1

Part 1 – Overview of Functions, Database & Files Overview In this tutorial we’ll be creating a very simple blog system. We won’t be using OOP yet in this tutorial. For creating a Blog using OOP in PHP, another more advanced tutorial will be written and posted as well. The same goes for creating a more advance CMS. However in this tutorial will just be creating a simple Blog system with php functions. Functions will be created for: * Connecting to Host & DB * Adding posts * Deleting posts * Adding replies * Deleting replies * Creating categories * Retrieving & Displaying Posts * Add user * Edit user profile * Display user profile * Search Also a simple 2 rows div layout will be created with a side-menu and main content div. Database Let’s start with creating the database for our simple blog. We’ll call it ‘simple_blog’. However you can call it anything you like as long as you set it correctly in the script later on. Now let’s create the tables ...

Linux References

2. Understanding files and folders Linux is made with one thought in mind: Everything is a file. A blank piece of paper is called a file in the world of computers. You can use this piece of paper to write a text or make a drawing. Your text or drawing is called information. A computer file is another way of storing your information. If you make many drawings then you will eventually want to sort them in different piles or make some other system that allows you to easily locate a given drawing. Computers use folders to sort your files in a hieratic system. A file is an element of data storage in a file system (file systems manual page). Files are usually stored on harddrives, cdroms and other media, but may also be information stored in RAM or links to devices. To organize our files into a system we use folders. The lowest possible folder is root / where you will find the user homes called /home/. / /home/ /home/mom/ /home/dad/ Behind every configurable opt...

PHP Error Handlings

error_log bool error_log ( string $message [, int $message_type = 0 [, string $destination [, string $extra_headers ]]] ) message_type error_log() log types 0 => message is sent to PHP's system logger, using the Operating System's system logging mechanism or a file, depending on what the error_log configuration directive is set to. This is the default option. 1 message is sent by email to the address in the destination parameter. This is the only message type where the fourth parameter, extra_headers is used. 2 No longer an option. 3 message is appended to the file destination. A newline is not automatically added to the end of the message string. 4 message is sent directly to the SAPI logging handler. eg: <?php // Send notification through the server log if we can not // connect to the database. if (!Ora_Logon($username, $password)) { error_log("Oracle database not available!", 0); } // Notify administrator by email if ...