This website is dedicated to common, day to day programming and database related Frequently Asked Questions. Popular Programming and Database Articles under one blog
Tuesday, September 1, 2009
Improving Performance by Profiling PHP Applications
One of the best things about programming in PHP is how easy it is to learn the language and its libraries. Everything seems to fit together and you can almost guess how to do a specific task, even not knowing much about the function that you need to use. A lot of times you will just try doing something and be surprised that the language has that specific feature.
PHP performance tips
Profile your code to pinpoint bottlenecks
Before changing your code, you'll need to determine what is causing it to be slow. You may go through this guide, and many others on optimizing PHP, when the issue might instead be database-related or network-related. By profiling your PHP code, you can try to pinpoint bottlenecks.Friday, August 28, 2009
PHP global arrays
The Global Array List
Old Form | New Form | Description |
---|---|---|
-- | $GLOBALS[] | The complete list of all global variables, including user defined variables at the global level. |
$HTTP_GET_VARS[] | $_GET[] | All variables received as part of a query string in the requesting URL, or HTML form data transmitted using the GET method. |
$HTTP_POST_VARS[] | $_POST[] | All variables recieved as an inline posted data set, normally through using the POST method in an HTML form. |
$HTTP_POST_FILES[] | $_FILES[] | References to all files received, most commonly from HTML forms, using the POST method. |
$HTTP_COOKIE_VARS[] | $_COOKIE[] | Any cookies returned from the client. The index key name matches the cookie name. |
-- | $_REQUEST[] | A more recent addition that stores all user variables, including elements from the $_GET[] , $_POST[] , and $_COOKIE[] arrays. Prior to PHP4.3, this also includes the $_FILES[] array. |
$HTTP_SERVER_VARS[] | $_SERVER[] | Information about the server session and the HTTP connection with the client. |
$HTTP_ENV_VARS[] | $_ENV[] | Information about the server environment and system defined values. |
$HTTP_SESSION_VARS[] | $_SESSION[] | IF PHP is being used for session management, this array is to store any session variables that need to be stored on the server between calls from the client. |
MySql - InnoDB vs MyISAM
Most people who use MySQL know that MyISAM and InnoDB are the two most-common database engines available with the popular open-source database provider.
Storage Engine
The storage-engine is what will store, handle, and retrieve information for a particular table. As hinted by the opening of this article, there is no be-all end-all solution to every or even most cases. Each has very specific pros and cons that by design can not be all-inclusive of each other.
Storage Engine
The storage-engine is what will store, handle, and retrieve information for a particular table. As hinted by the opening of this article, there is no be-all end-all solution to every or even most cases. Each has very specific pros and cons that by design can not be all-inclusive of each other.
What is a full text search in mysql?
According to the MySQL manual, Full-text is a “natural language search”; it indexes words that appear to represent the row, using the columns you specified
MySQL has had FULLTEXT searching in one form or another since version 3.23.23. FULLTEXT indices in MySQL allow database administrators and programmers to designate any character-based field (CHAR, VARCHAR, or TEXT) as a FULLTEXT index, which allows for complex text searching against data stored in those fields.
MySQL has had FULLTEXT searching in one form or another since version 3.23.23. FULLTEXT indices in MySQL allow database administrators and programmers to designate any character-based field (CHAR, VARCHAR, or TEXT) as a FULLTEXT index, which allows for complex text searching against data stored in those fields.
Tuesday, June 16, 2009
How Can I Use Javascript to Allow Only Numbers?
function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
Add the following to the onkeypress event of your text box
return isNumberKey(event)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
Add the following to the onkeypress event of your text box
return isNumberKey(event)
Subscribe to:
Posts (Atom)