Category: PHP Frameworks
MySQL | How to support European characters on database level
European characters like è é å ñ ü ,à, è, ì, ò, ù – À, È, Ì, Ò, Ù, ™, © ,• , ∑, α, β, «, » do not get inserted correctly in MySQL by default. To fix it,
MYSQL | #1293 – Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP
Suppose we want to have columns created_date and last_modified_time with default timestamp in any table in MySQL/Phpmyadmin. Let us take an example of Students table. Create table Students using following query : CREATE TABLE students( id INT AUTO_INCREMENT PRIMARY KEY
CakePHP | How to implement Internationalization in CakePHP 3.X
To implement Internationalization, CakePHP will pick all your strings which start with “__(“ double underscore ) and generate a default file for you. For Example: one of the strings defined in our project is as below: echo __ ( ‘ Gift
PHP | Convert Special Characters to HTML entities without using htmlspecialchars( ) function
We can’t use special characters like >,<,”,’ etc directly in code because browser mixes these characters with HTML tags and gets confused. So we can use HTML entities if we want to use special characters in our code. Below are
How to access javascript array in php on submit
Suppose you have a Javascript array and want to send it to the server side on page submit then you can use this method. Suppose we have a Javascript array with 3 elements: var test = [“test1”, “test2”, “test3”]; Now
PHP – Possible reasons of “Allowed memory size exhausted” error
Most of the times when we get memory exhausted error, we normally think that the memory allocated for php program execution in php.ini file is not sufficient and raise this limit to try to fix the error. However, code inefficiency
How to add combobox in editable datagrid using jQuery EasyUI
Following is the code to add Combobox in editable data grid: Index.html: <table id=”dg” title=” Combobox in editable datagrid ” style=”width:100%;height:700px” toolbar=”#toolbar” pagination=”true” rownumbers=”true” fitColumns=”false” singleSelect=”true” autoSave=”true” data-options=”pageSize:50″> <thead> <tr> <th field=”Item_number”width=”100″ editor=”{ Type:’combobox’, Options:{url:’get_itemname.php’, valueField:’itemno’, textField:’itemname’ }}”>Item Name</th> <th
PHP | Adding text over an image
In order to add text over an image, following PHP code can be used. Read the comments to understand purpose of code statements: <?php header (“Content-type: image/jpeg”); //setting the content type //variable containing the string to be written on the
PHP | better way to include a file
Have a look at this folder structure: Test Folder1 Abc.php Folder2 Qwerty.php Now in Abc.php file, try to include Qwerty.php using the following code: Abc.php include(‘../Folder2/Qwerty.php’) It will give this error: Fatal error: Failed opening required ‘../Folder2/Qwerty.php’ (include_path=’.:/usr/local/lib/php’) in /Test/Folder1/Abc.php