MEET - Phir se ruth jaao…
“Phir se ruth jaao, koi manayega….
Dil se dil ka taar jod jayega…..
Kabhi lage ki `MEET` door hai aagar…..
Aap chaah ke to dekho, kahin bhi ho laut aayega.”
- MEET (2nd Aug 2010)
“Phir se ruth jaao, koi manayega….
Dil se dil ka taar jod jayega…..
Kabhi lage ki `MEET` door hai aagar…..
Aap chaah ke to dekho, kahin bhi ho laut aayega.”
- MEET (2nd Aug 2010)
<?php
$ip=$_SERVER['REMOTE_ADDR'];
echo “<font face=’Verdana’ size=’3′><b>IP Address= $ip</b>”;
$url = “http://www.ipmango.com/api.php?ip=”.$ip; $xml = simplexml_load_file($url);
echo “City : {$xml->city} <br />”;
echo “Region : {$xml->region} <br />”;
echo “Country Name : {$xml->countryname} <br />”;
echo “Latitude : {$xml->latitude} <br />”;
echo “Longitude : {$xml->longitude} <br />”;
?>
Refer: http://www.shefeekj.com/get-ip-and-location-using-php.html
Difference Between PHP4 & PHP 5
1. Soap, MySQLi and Sqlite extension introduced in php5
2. Exception handling has been introduced in PHP5 (i.e. try and catch statements)
3. Objects can iterate through foreach in PHP5
$object = new IteratorTest();
foreach ($object as $value) {
print $value;
}
4. Added public/private/protected access modifiers in PHP5
5. Introduced Unified constructor name __construct() in PHP5
6. Object destructor support by defining a __destructor() method in PHP5
7. Introduced abstract classes & methods
Good article to go through:
http://devzone.zend.com/article/1714
Difference between MyISAM and InnoDB
1. Transactions: InnoDB support transactions means You can commit and rollback with InnoDB but with MyISAM once you issue a command it’s done. But MYISAM does not support any database transactions means if the transactions related to large amount of data transfer it will not provide because memory is less.
2. Locking: INNODB provide the row level locking means if you are performing an insert into InnoDB table only that row will be locked not the entire table. While MYISAM provide the table level locking means if the data in one row has been modified, the entire table will lock for the next process.
3. Foreign keys – InnoDB support FK constraint but MYISAM tables do not support.
4. Data Types: MYISAM provide a full variety of datatypes, but INNODB will not.
5. Full Text Search: InnoDB does not support Full Text search but MyIsam provide full text search.
6. Memory Space: MYISAM occupies less memory sapce for tables rather than InnoDB tables.
Code:
// Add this in top of the script
$page_start_time = microtime(true);
// Add this in top of the script
if($page_start_time != 0){
$page_end_time = microtime(true);
$differ = number_format($page_end_time - $page_start_time , 4);
echo “Page Load Time: ”.$differ.” Seconds”;
}
MYSQL Query to export data order by given values in comma separated string. If you want to get the record in an specific order you can do it like this:
SELECT * FROM {TABLE_NAME} WHERE {FIELD_NAME} IN ( 23, 234, 543, 23 ) ORDER BY FIELD({FIELD_NAME}, 23, 234, 543, 23 )
Example: SELECT * FROM `product_master` WHERE paSKU IN (’1a6′,’1a1′,’1a8′,’1a3′,’1a4′) ORDER BY FIELD (paSKU,’1a6′,’1a1′,’1a8′,’1a3′,’1a4′)
Install json
1. Install json - This was actually trickier than expected. I assumed I would be able to install this via pear. Apparently, a PEAR Services_JSON package was developed, but it has never been accepted into the official repository. The trick instead is to use the PECL json package. This was as easy as running pecl install json and watching the compiler do its thing. When it’s done you should have a json.so file in your PHP modules directory. (Mine is /usr/lib/php/modules/.)
2. Add json.ini file to /etc/php.d/ - This file is pretty simple. Simply add extension=json.so to this file and that will enable the extension.
3. Restart Apache - Not much more to add here. Without the restart, the extension won’t be loaded.
Curl with post variables
curl -v \ –data ‘form=1&form_refresh=1&name=admin&password=onsumaye{}123&enter=Enter’ \ ‘http://domain.com
Change Hostname
hostname utils.domain.com
vi /etc/sysconfig/network