Thursday, 24 July 2014

Important PHP Interview Questions and Answers - jQuery, SQL Modes, Client Programs and Reset

How to get jQuery nth Element
//include jQuery file
<script type="text/javascript" src="jquery.js"></script>
<script>
function go_to(id_number){     
     var obj=jQuery('div.mydiv ul li:nth-child('+id_number+') a');      
     alert(obj.html()) 
}
go_to(3);
</script>

jQuery Multiple File Upload Plugin
http://www.fyneworks.com/jquery/multiple-file-upload/#tab-Overview


jQuery Paging
Here you can table Sorting, Searching and Paging in Easy Way
http://www.datatables.net/examples/


Paypal return error : malformed

Hi,
I am using payapl gateway for payment in my project.
It is working fine for sandbox(test account) but no working for paypal (original paypal detail on client server);
It return following errror from paypal
  Array
    (
        [Error] => Array
            (
                [Number] =>  malformed
            )

    )



Solution: When you are sending amount in api call, sent amount with 2 digit decimal places. For Example 100.02 OR 22.32 


How to Download Openinviter?
You want to implement openInviter and your project is in Wordpress, Joomla, Drupal, Social engine, phpBB, Dolphin, Symfony & webmail. then Its maximum 2-5 min work. Just download the plugin/component & install in your application it will start working.


If your project is in some other CMS or Core PHP, then you need to download the files.
Include the file & call the appropriate function. It will start working...
http://openinviter.com/download.php


What is PHP?
PHP is language that enable web-developer to create the dynamic web pages with the use of HTML/CSS/JavaScript.


What is Full Form of PHP?
Full Form of PHP is Personal Home Page but now it stand for PHP: Hypertext Preprocessor


Who is Father of PHP?
Rasmus Lerdorf


When php was invented?
PHP was created by Rasmus Lerdorf in 1995


What is Rest
REpresentational Sate Transfer.
It is set of architectural rules by which you design a web service that focus on transfer of data from one server to another ignorance of operating system and language.
It was introduced in 2000.


What is Invoking Client Programs?
MySQL client programs can be invoked from the command line. For example from a Windows console prompt OR a Unix shell prompt.
For Example
shell> mysql -h localhost -p -u myname


What are Server SQL modes?
It define what SQL syntax, MySQL should support and what kind of data validation checks it should perform.
It easier to use MySQL in different environments.


How many server SQL modes?
The MySQL server can operate in different SQL modes, and can apply these modes differently for different clients.


Thanks for reading our page
http://www.web-technology-experts-notes.in/2014/07/important-php-interview-questions-and-Answers.html

Monday, 21 July 2014

Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation - Multilingual Website

In MySqL Database, we stored lots of data like city address, city description and city full description etc. Many times we stored different language's character like Chinese OR Japanese which take multibyte to single single character.
When we stored multibyte-character then it means we can also search the data from multibyte-character string.


So, Basically while we are working with multilingual character then we face two common type of problems.
  1. Multibyte Character not storing properly in Database.
  2. Search with multibyte character, MySql send error like "Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation"
Both are different issues,  but solution is Simple and same.




Problem 1: Character not storing properly: Collation must be "utf8_general_ci" to stored multibyte character properly in database.

Sample Table for store multi characters
CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(256) CHARACTER SET utf8 DEFAULT NULL,
  `detail` text CHARACTER SET utf8,
  `created_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;



Problem 2: Search with multi character, Db is sending error: While Searching multicharacter, your database sending below error "Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation OR similar issues"

To get rid of this, you have to update the collation of your search fieldCollation must be utf8_general_ci for search multicharacter
ALTER TABLE `users1` CHANGE `name` `name` VARCHAR(256) CHARACTER SET utf8 COLLATE utf8_general_ci;

If you don't want to change the Collation of field we can also pass the utf8_general_ci explicity explicitly in search query.
select * from users WHERE name = "gdaƄsk" COLLATE utf8_unicode_ci


5 Best Related Posts are Following:1. Mysql Privileges - Types of privileages in MySql - How do I grant privileges in MySQL
2. Calculate a Sum of Time using MySQL
3. Mysql Interview Questions And Answers - Atomicity, Dedlock, Client Program, Mysql Mode, Mysql Sensitivity Of Identifiers And Mysql Errors
4. Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation - Multilingual Website
5. Difference Between MyISAM and innoDB - MySQL