April 14, 2013 asvignesh

Here is the solution to fetch the data from another Database instance in word press How To Use WPDB Class to connect and fetch data from another database host Let’s say you’ve installed wordpress into the database wp_wordpress and you want to fetch some data from another independent database which has nothing to do with wordpress (ex. mydb). Here’s how you can do it. Querying for Data Using WPDB Now, here’s the trick. You have to instantiate a new WPDB instance $mydb= new wpdb(‘username’,’password’,’db_name’,’db_host’); $rows = $mydb->get_results(“select columnName from tableName”); foreach ($rows as $obj) { echo $obj->columnName; } That saves…

6+ years of experience in building data protection, copy data management and storage management applications, automation software and plugins for private and public clouds

Disclaimer :

This is a personal weblog. The opinions expressed here represent my own and not those of my employer. my thoughts and opinions change from time to time… This weblog is intended to provide a semi-permanent point in time snapshot and manifestation of the various memes running around my brain, and as such any thoughts and opinions expressed within out-of-date posts may not the same, nor even similar, to those I may hold today.

April 14, 2013 asvignesh

Highlight your php code in your website or in your blog post Instead of using external tools or third party code to highlight the syntax of php code in your website you can use the inbuilt function of php highlight_string or highlight_file Highlight_string is the function to highlight the php syntax of the block of code Here is the example for the highlight_string <?php $code = ‘ <?php //array with files to allow $allowed = array(“index.php”, “menu.php”, “about.php”); // get the filename $file = $_GET[file]; if(file_Exists($file)){ if(in_array($file, $allowed)){ // check if it is part of the allowed list highlight_file($file); //highlight…

6+ years of experience in building data protection, copy data management and storage management applications, automation software and plugins for private and public clouds

Disclaimer :

This is a personal weblog. The opinions expressed here represent my own and not those of my employer. my thoughts and opinions change from time to time… This weblog is intended to provide a semi-permanent point in time snapshot and manifestation of the various memes running around my brain, and as such any thoughts and opinions expressed within out-of-date posts may not the same, nor even similar, to those I may hold today.

April 7, 2013 asvignesh

Session often breaks in codeigniter ??? Here is the fix ! I developed e-commerce website using php codeigniter and it is using database to store session values. But the session is lost if it has more data in it I have spent some days checking about it and changed the third party session library , it has lots of limitations again i switched back to codeigniter default session library and trying to fix the issue finally i found out the issue in it. It was failing to unserialize the session data stored in the user_data field in ci_session table So…

6+ years of experience in building data protection, copy data management and storage management applications, automation software and plugins for private and public clouds

Disclaimer :

This is a personal weblog. The opinions expressed here represent my own and not those of my employer. my thoughts and opinions change from time to time… This weblog is intended to provide a semi-permanent point in time snapshot and manifestation of the various memes running around my brain, and as such any thoughts and opinions expressed within out-of-date posts may not the same, nor even similar, to those I may hold today.

April 7, 2013 asvignesh

Best practises in checking codeigniter sessions There are many practices in checking the session conditions for whether the user is logged in or not Usually we check in the codeigniter controllers function my_function() { $user = $this->session->userdata(‘user_id’); if (!isset($user)) { $logged_in = false; } else { $logged_in = true; } } This 4-8 lines of code you need to check in every controller , So you can create a codeigniter library and call the library function in every controller , It is easy to code and also in modifying the code  Create a my_library.php file in application/libraries Copy the following…

6+ years of experience in building data protection, copy data management and storage management applications, automation software and plugins for private and public clouds

Disclaimer :

This is a personal weblog. The opinions expressed here represent my own and not those of my employer. my thoughts and opinions change from time to time… This weblog is intended to provide a semi-permanent point in time snapshot and manifestation of the various memes running around my brain, and as such any thoughts and opinions expressed within out-of-date posts may not the same, nor even similar, to those I may hold today.