Following query would be demonstrate how to run a MySQL query without Cache enable.
Keep Querying ๐
9 Jul
Following query would be demonstrate how to run a MySQL query without Cache enable.
Keep Querying ๐
24 Apr
I was trying to redirect all of my one wordpress blog setup which is setup on sub directory to the dedicated wordpress domain. To do so I have added following in directory based blog’s htaccess file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example1.com$ [NC]
RewriteCond %{REQUEST_URI} ^/wp-blog/(.*) [NC]
RewriteRule ^(.*)$ http://example2-blog-site.com/%1
RewriteCond %{HTTP_HOST} ^www.example1.com$ [NC]
RewriteCond %{REQUEST_URI} ^/wp-blog/(.*) [NC]
RewriteRule ^(.*)$ http://www.example2-blog-site.com/%1
15 Apr
เชเซเชฎ เชเชฐเชฟเชจเซ เชญเซเชฒเชพเชฏ เชคเชพเชฐเซ เชชเซเชฐเซเชฎ เชฎเชพเชฐเชฟ เชฎเชพ!
เชเชเซ เชฎเชจเซ เชชเชจ เชฎเชจเซ เชฆเซเชเชพเชฏ เชเซ เช
เชถเซเชฐเซเช เชจเชพ เชฌเชฟเชจเซเชฆเซ เชคเชพเชฐเชฟ เชเชเซ เชจเชพ เชเชฟเชจเชพเชฐเซ เชเชฏเชพเชฐเซ เชเซเช เชฎเชจเซ เชฆเซเช เชฆเซ เชเซ.
เชเซเชฎ เชเชฐเชฟเชจเซ เชญเซเชฒเชพเชฏ เชคเชพเชฐเชฟ เชนเซเชฎเซเชซ เชฎเชพเชฐเชฟ เชฎเชพ!
เชเชเซ เชชเชจ เชฎเชจเซ เชฏเชพเชฆ เชเชตเซ เชเซ เชคเชพเชฐเชฟ เชธเชพเชกเชฟ เชจเซ เชชเชพเชฒเชต เชฎเชพเชฐเซ เชเชฎเซเชเชฟเชจ เชฎเชพ.
เชเซเชฎ เชเชฐเชฟเชจเซ เชญเซเชฒเชพเชฏ เชคเชพเชฐเซ เชธเชนเชพเชฐเซ เชฎเชพเชฐเชฟ เชฎเชพ!
เชเชเซ เชฎเชจเซ เชชเชจ เชฎเชจเซ เชเชฐเซเชฐ เชเซ เชคเชพเชฐเซ เชเชญเซ(เชเซเชเซ) เช เชธเซเชตเชพเชฐเซเชฅเชฟ เชฆเซเชจเชฟเชฏเชพ เชฎเชพ.
15 Apr
I do remember my old days when I am new to MySQL and Web industry. At that point of time whenever I have to implement search functionality I was used to implement it via LIKE keyword as below:
At that time I am not aware of full-text search. When I explore through Full-Text search I laugh at myself just because of silly stuff I was doing. I found Full-Text search is much powerful, efficient, faster and accurate way to present results of search query.
To perform Full-Text search you need to define indexing on required columns.
There are few constrain to use Full-Text search:
Basic syntax ofย full-text search function is:
in above, MATCH takes comma separated column’s name and AGAINT takes string to be searched.
There are three different types of full-text searches available in MySQL
9 Apr
Today I came across strange problem. Let me explain you exact problem and solution for that.
I have e-commerce site developed. After product added to shopping cart when user trying to checkout I am redirecting user from Shopping cart to Account page (if user already logged in) or Login Page (if user not logged in) on checkout. To make transaction more secure, Transition from shopping cart to Account page or Login Page is HTTP (Non-Secure) to HTTPS (Secure). Whenever I switch from HTTP to HTTPS, My stored shopping cart items which are stored in $_SESSION variable get lost.
After much hair pooling to trace and fix this issue I have found below solution:
When you switch between the HTTP and HTTPS services on the same server, your HTTP session ID is not being passed to the HTTPS session. Here we need to pass session_id which is created by HTTP to HTTPS page. so HTTPS resume similar session on server rather then creating new session for HTTPS request. Below is the code to explain it via example:
Consider you are redirectingย http://www.example.com/page1.php toย https://www.example.com/page2.php
page1.php script:
page2.php script:
Hope above given solution help others as well.
Post comments if you have any question.
Happy Coding. ๐
5 Apr
Following error levels constants available into PHP for error_reporting which are configured directly from php.ini, .htaccess or directly from php script using ini_set function:
Value | Constant | Description |
---|---|---|
1 | E_ERROR | Fatal run-time errors. These indicate errors that can not be recovered from, such as a memory allocation problem. Execution of the script is halted. |
2 | E_WARNING | Run-time warnings (non-fatal errors). Execution of the script is not halted. |
4 | E_PARSE | Compile-time parse errors. Parse errors should only be generated by the parser. |
8 | E_NOTICE | Run-time notices. Indicate that the script encountered something that could indicate an error, but could also happen in the normal course of running a script. |
16 | E_CORE_ERROR | Fatal errors that occur during PHP’s initial startup. This is like an E_ERROR, except it is generated by the core of PHP. |
32 | E_CORE_WARNING | Warnings (non-fatal errors) that occur during PHP’s initial startup. This is like an E_WARNING, except it is generated by the core of PHP. |
64 | E_COMPILE_ERROR | Fatal compile-time errors. This is like an E_ERROR, except it is generated by the Zend Scripting Engine. |
128 | E_COMPILE_WARNING | Compile-time warnings (non-fatal errors). This is like an E_WARNING, except it is generated by the Zend Scripting Engine. |
256 | E_USER_ERROR | User-generated error message. This is like an E_ERROR, except it is generated in PHP code by using the PHP function trigger_error(). |
512 | E_USER_WARNING | User-generated warning message. This is like an E_WARNING, except it is generated in PHP code by using the PHP function trigger_error(). |
1024 | E_USER_NOTICE | User-generated notice message. This is like an E_NOTICE, except it is generated in PHP code by using the PHP function trigger_error(). |
2048 | E_STRICT | Enable to have PHP suggest changes to your code which will ensure the best interoperability and forward compatibility of your code. |
4096 | E_RECOVERABLE_ERROR | Catchable fatal error. It indicates that a probably dangerous error occured, but did not leave the Engine in an unstable state. If the error is not caught by a user defined handle (see also set_error_handler()), the application aborts as it was an E_ERROR. |
8192 | E_DEPRECATED | Run-time notices. Enable this to receive warnings about code that will not work in future versions. |
16384 | E_USER_DEPRECATED | User-generated warning message. This is like an E_DEPRECATED, except it is generated in PHP code by using the PHP functiontrigger_error(). |
30719 | E_ALL | All errors and warnings, as supported, except of level E_STRICT in PHP < 6. |
5 Apr
There are little misunderstanding regarding two good configuration variablesย available in php.ini.
Both of the above settings are good for debugging and keep your application error free.
Happy Coding!
Post your comments if you have any question.
5 Apr
Few days back I had plan to explore magento as there are much hip-hop of it now a days. As a web developer I was curious to know how much powerful it is with compare to osCommerce, Zencart, x-cart and CRE-Loaded. I have setup magento on my machine using XAMP using http://localhost/magento.
After successfull installation of the magento store on XAMP I had tried to login to admin panel by visiting http://localhost/magento/admin or http://localhost/magento/index.php/admin. I am no longer login into admin account
In fact in the โLog in to Admin Panelโ window whenever you provide wrong password/username combination it displays โInvalid Username or Password.โ But whenever you provide correct password it does not show anything.
The problem occurs because magneto could not store cookies. We run it as localhost and localhost is not true domain but to store cookies we need a domain. Thatโs why login stops without saying any word.
http://localhost/magento/index.php/admin will fail but if you connect as http://127.0.0.1/magento/index.php/admin it will work.
Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.
Find:
and replace
After this save the file. And try to login into the admin.
Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.
Find below at line 96:
Replace the code found in line 96 with this one:
Clear your browserโs cookies to start with a clean slate then clear the Magento cache by deleting all the contents of the var\cache
Happy Coding!
23 Jan
Following linux command use to copy file/folder from server to server:
For Example:
scp -rv user@host:/path/to/source/dirORfile /path/to/destination
5 Dec
Let me explain virulhosts creation by taking example.ย Lets say you want to create an virualhost for mylocalsite.com.
Follow as step below:
and uncomment it as below(i.e remove # in front of line)
<VirtualHost *:80>ServerName localhost
DocumentRoot C:/wamp/www
ErrorLog C:/wamp/www/logs/error.log
CustomLog C:/wamp/www/logs/access.log common
</VirtualHost>
Drop me comment if you have any problem. I will surely help you.