January 20 2013

Jquery Array Key Search

Tagged Under : ,

jquery
How to using jQuery search the array key or check for a key exists in an array.

Since JavaScript doesn’t really have associative arrays, then we only write a function to check.

January 20 2013

Jquery Static Array

Tagged Under : ,

jquery
Use a short code to get a value from the database the easy way is using Ajax.

But the short code and value are fixed, we keep it in database is for future reuse it.

So I use another way to get the value. That is an array. use array key find the value.

January 16 2013

Jquery Remove White Spacing

Tagged Under : ,


Use jQuery remove white space to avoid user escape required field.

There is one of the functions from jQuery which help to solve this problem.

January 16 2013

Jquery Find Attribute Name Value of Input

Tagged Under : ,

jquery
Because want use jQuery get the input box value but the input box without the id attribute.

Then need use name attribute to find the input box get the value.

January 12 2013

Mysql replace() function

Tagged Under : ,

MySQL
Because I found that record save inside the database have typo problem.

How to solve it? Normally I will use PHP str_replace to solve the issue. But now requires use SQL to print out all the record and replace the typo.

January 12 2013

Mysql regexp and rlike function

Tagged Under : ,

MySQL
Mysql regexp or rlike function it same as PHP preg_match() function.

It save the time write code and filter the data.

January 12 2013

Mysql lpad() function

Tagged Under : ,

MySQL
Using Mysql function add asterisk (*) in front of the string.

Example Output:
********MyTestString
*******MyTestString2
**********TestString

January 10 2013

Mysql instr() Function

Tagged Under : ,

MySQL
Find the string position. I think most of the Software Engineer will use server side script to do it. I also is the one. For PHP, I will use strpos to get the position.

January 10 2013

Mysql find_in_set() Function

Tagged Under : ,

MySQL
Generally, we stores various values of choices in 1 column of database. For example, we store user’s preferred categories in user table’s. value stored in this field will be like this 1,2,12,22,4

January 09 2013

Using .htaccess Protect Your Site

Tagged Under : , ,

Except from apache you can let your .htaccess file tighten up your site’s security and give extra level of protection.

I am going listing out few example and show you how to use it or where to use it. You don’t have to use every single one, just whatever you feel would help you improve your site security.