<?php
$query = db_select('table1')->fields('users')->execute();
$count = $query->rowCount();
?>
Web Development Information [PHP, DRUPAL, MYSQL, MAGENTO, JQUERY, JAVASCRIPT, CSS, HTML5]
Thursday, December 26, 2013
Thursday, April 4, 2013
Magento site redirected to localhost from live server
After developed magento website in localhost, files will be moved to live server environment. The following needs to be changed in your live server. Other wise your live server URL will redirected to localhost path.
Step 1: Edit old URL values in database
Table: core_config_data
Columns: web/unsecure/base_url, web/secure/base_url
In this table you need to edit the field named value to your live environment url!
Old Values:
web/unsecure/base_url - http://localhost/magentotest
web/secure/base_url - https://localhost/magentotest
New Values:
web/unsecure/base_url - http://magentolive.com
web/secure/base_url - https://magentolive.com
Step 2: Clear the cache folder
Magento retains all configuration cache in /var/cache folder
You should clear the entire contents in this cache folder. Magento will regenerates all these files when needed.
Step 1: Edit old URL values in database
Table: core_config_data
Columns: web/unsecure/base_url, web/secure/base_url
In this table you need to edit the field named value to your live environment url!
Old Values:
web/unsecure/base_url - http://localhost/magentotest
web/secure/base_url - https://localhost/magentotest
New Values:
web/unsecure/base_url - http://magentolive.com
web/secure/base_url - https://magentolive.com
Step 2: Clear the cache folder
Magento retains all configuration cache in /var/cache folder
You should clear the entire contents in this cache folder. Magento will regenerates all these files when needed.
Saturday, January 19, 2013
Remove index.php from requested url in magento
Steps to remove index.php from requested url in magento.
1. Goto root/var folder and open .htaccess file and remove existing lins and repalce the following lins,
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
2. Goto System->Configuration->Web->Search Engines Optimization, change to "Yes".
3. Goto System->Cache Management->Clear all cahces
1. Goto root/var folder and open .htaccess file and remove existing lins and repalce the following lins,
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
2. Goto System->Configuration->Web->Search Engines Optimization, change to "Yes".
3. Goto System->Cache Management->Clear all cahces
Friday, December 28, 2012
Overwrite Default Javascript Funtions
We can overwrite default java script function by using the following way: For example overwrite alert function
function alert(msg) {
console.info(msg);
}
function alert(msg) {
console.info(msg);
}
Monday, May 14, 2012
HTML5 Range Control
This is the another input type introduced in HTML5 control is range. Its acting like volume or percentage. Your can drag the point and set the value.
0<input type="range" name="percentage" value="0" oninput="x.value=parseInt(percentage.value)" /><output name="x">0</output>
Subscribe to:
Posts (Atom)