Five coding tips for PHP-MySQL hosting
PHP and MySQL happen to be the favorite scripting-database combination for most websites. The popularity is due to the simplicity and effectiveness of PHP and the functionalities of MySQL. However, there are some tips and tricks which can help you perform better with your PHP hosting, and here we list the top five Do’s for you:
Use the quotes effectively
String variables should be quoted with single quotes, while there should not be any quotes around numeric data. This is effective while using them inside echo, which itself should be quoted with double quotes.
Enable error reporting
The php.ini file should be configured such that all errors, except for notices should be reported. This helps in proper debugging of the PHP script.
Use HTML and PHP alternatively, when required
Instead of using echo to write large sections of HTML, PHP codes can be temporarily closed to accommodate HTML and then PHP can be restarted.
Include include files for better effect
The include files are extremely useful, in case a fixed element, such as header, footer needs to be included in all pages. This saves the pain of editing all pages if any modification is required on the fixed part.
Use MySQL datatypes according to the need
Apart from INT, there are other similar datatypes like TINYINT, SMALLINT, which can server the purpose and takes less space than INT.
BounceWeb provides extremely fast and reliable PHP-MySQL hosting.
Leave a Reply
You must be logged in to post a comment.