Archive

Archive for the ‘Techanical’ Category

9 Ways to Make your Computer Run Faster

June 28, 2016 Leave a comment

Categories: Techanical

Ajax Pagination in CodeIgniter Framework


Nice article .. with in 15 minute you can integrate ajax pagination

Ajax Pagination in CodeIgniter Framework

Categories: ajax, Techanical

Disable select box based on check box click

April 22, 2016 Leave a comment

<form>
  <input type="checkbox" id="pizza" name="pizza" value="yes">
  <label for="pizza">I would like to order a</label>
  <select id="pizza_kind" name="pizza_kind">
    <option>(choose one)</option>
    <option value="margaritha">Margaritha</option>
    <option value="hawai">Hawai</option>
  </select>
  pizza.
</form>

 src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">

  var update_pizza = function () {
    if ($("#pizza").is(":checked")) {
        $('#pizza_kind').prop('disabled', false);
    }
    else {
        $('#pizza_kind').prop('disabled', 'disabled');
    }
  };
  $(update_pizza);
  $("#pizza").change(update_pizza);
Categories: Techanical

Android json string object to javascript variable

April 4, 2016 Leave a comment

http://stackoverflow.com/questions/9036429/convert-object-string-to-json

 

97down voteaccepted

If the string is from a trusted source, you could use eval then JSON.stringify the result. Like this:

var str = "{ hello: 'world', places: ['Africa', 'America', 'Asia', 'Australia'] }";
var json = JSON.stringify(eval("(" + str + ")"));

Note that when you eval an object literal, it has to be wrapped in parentheses, otherwise the braces are parsed as a block instead of an object.

I also agree with the comments under the question that it would be much better to just encode the object in valid JSON to begin with and avoid having to parse, encode, then presumably parse it again. HTML supports single-quoted attributes (just be sure to HTML-encode any single quotes inside strings).

Categories: Techanical

Share in facebook

March 18, 2016 Leave a comment

version=v2.5  have to choose.

 

 

 

 

 

Categories: Techanical

Mysql: Selecting values between two columns

March 4, 2016 Leave a comment

SELECT * FSELECT * FROM `assessment_score` WHERE 5 BETWEEN statrange AND endrangeROM `assessment_score` WHERE 5 BETWEEN statrange AND endrange

Categories: Techanical

Remove \r\r\n mysql or php

February 16, 2016 Leave a comment

UPDATE assessment_type SET `assessment_desc` = REPLACE( REPLACE( `assessment_desc` , ‘\r’, ) , ‘\n’, )

 

Carriage return (\r) and line feed (\n) in MySQL

Categories: Techanical

January 28, 2016 Leave a comment

http://developerspark.net/2012/09/select-insert-update-and-delete-query-in-zend-framework/

In Zend Framework  It’s very easy to run select, insert, update and delete query,

Select  Query in Zend Framework :

$sql = $this->select()
->from('tablename',array('*'))
->where('userID=?',1);
$data = $this->fetchAll($sql)// This query will return a multidimensional Array.This work as a  mysql_fetch_array()

$data = $this->fetchRow($sql); // Get Row

Insert query in Zend Framework :

Zend  Framework provide the Insert function for insert  the data  :

You can use the Table object to insert rows into the database table on which the Table object is based. Use the insert() method of your Table object.

Create the Object :

   <?php $userTable = new users()?>
<?php

$userProfileData = array(

'first_name'=>'David',
'add_line1'=>'UK',
'description'=>'something'

);

$userTable->insert($userProfileData);

?>

 

Update query in Zend Framework :

Zend  Framework provide the Update  function for update  the data  :

You can use the Table object to update the rows into the database table on which the Table object is based. Use the update() method of your Table object.

Create the Object :

 <?php $userTable = new users()?>

<?php

$userProfileData = array(

'first_name'=>'David',
'add_line1'=>'UK',
'description'=>'something'

);

$userId =2;

$userTable->update($userProfileData,'userID='.$userId);

?>


Delete Query In zend Framework :

You can delete rows from a database table using the delete() method.

Create the Object :

<?php $userTable = new users()?>
<?php

$userId = 2 ;
$userTable->delete('user_id='.$userId); ?>

 



 

Categories: Techanical

Awesome video player to intagrate to your wordpress site

January 28, 2016 Leave a comment
Categories: Techanical

How to login with email only no username in wordpress

January 19, 2016 Leave a comment

It’s possible, you must change the filter for the name.

// remove the default filter
remove_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
// add custom filter
add_filter( 'authenticate', 'fb_authenticate_username_password', 20, 3 );
function fb_authenticate_username_password( $user, $username, $password ) {

    // If an email address is entered in the username box, 
    // then look up the matching username and authenticate as per normal, using that.
    if ( ! empty( $username ) )
        $user = get_user_by( 'email', $username );

    if ( isset( $user->user_login, $user ) )
        $username = $user->user_login;

    // using the username found when looking up via email
    return wp_authenticate_username_password( NULL, $username, $password );
}



===============================


http://wordpress.stackexchange.com/questions/51678/how-to-login-with-email-only-no-username