Categories
Codeigniter Open Source PHP Programming

[Solved] Invalid DB Driver in Codeigniter

Invalid DB Driver : Generally this issue comes when we make changes in system files or remove them accidentally. I also face same issue yesterday and i did a lot research about it and found three solutions that i am going to share with you.

Solution 1: MySQLi installation and configuration

Invalid DB Driver : Please make sure MySQLi Driver is installed and enabled in Apache. If it is not installed then install MySQLi for php and enable it in Apache.

Solution 2: Check System Directory of Codeigniter Project

Invalid DB Driver : Go to Go to system/database/driversand check mysqliand mysqldirectory exist at this location other get the files from fresh codeigniter and paste in to same directory.

Solution 3: Change The DB Driver from mysql to PDO

Go to application/config/database.phpand change the database driver mysqlito PDO and also change the dnswith proper arguments like pgsql:host=localhost;port=3306;dbname=myproject

$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
    'dsn'   => 'pgsql:host=localhost;port=3306;dbname=myproject',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '*******',
    'database' => 'myproject',
    'dbdriver' => 'pdo',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => FALSE,
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

Hope this article is useful and solve your problem. If you still facing issue then join our community and ask your question there. You will get instant reply. You can also leave a comment here, I will be surely reply you.

 

Thanks.

Sill Facing issue ? You can hire a expert from Codeigniter Developers in minimum cost [Less then half hour work]

Note :This solution is for codeigniter 3.0 – Framework of PHP Programming Language.

Categories
General Hacks

Snapdeal Affiliate Hub Earn money online

Snapdeal Affiliate Hub:

Snapdeal introduce its new Snapdeal Affiliate Hub. Snapdeal Affiliate Hub is much better than previous version. It is similar to Flipkart Affiliate and Amazon Associate program. Snapdeal Affiliate Hub comes with many affiliate tools like Static banners, Snapdeal Search Bar and Affiliate URL generator.

KEY FEATURES OF SNAPDEAL  AFFILIATE HUB:

Some key highlights of the changes that you will notice already are as follows:

  • Simpler and more intuitive user interface.
  • Product and category level reporting for better analysis of orders placed.
  • Tools to search for products and get affiliate links automatically.
  • Bookmarklet tool to get affiliate links for the pages you are browsing on Snapdeal.com in just 1-click.
  • Static banners and a Snapdeal Search Bar you can add to your website.
  • Product feeds – available both through downloadable CSV and XML files, and a feeds API.

You will see all the latest announcements, updates and notifications in your Snapdeal Affiliate Hub home page.  To getting payment, you should your billing details given below.

  • Payee Name: Name of the bank account holder.
  • Bank Account number to which the payments will be wired.
  • Permanent Account Number (PAN).
  • The IFSC code corresponding to your account number.

And a copy of cancelled cheque is required to mail at affiliate@snapdeal.com.

For international affiliate following documents are mandatory.

  • Permanent Establishment Certificate
  • Form 10F
  • Form W10 (Only for US based affiliates)
  • Tax Residency Certificate
  • Bank Details

There is no minimum amount required to be achieved for the commission to be paid out. Your entire commission amount is wired into your account during the final payments each month.

The affiliate member with valid PAN is eligible for 10% TDS from their affiliate income and 20% TDS will be deducted from income of the member without PAN details. TDS is deducted for payouts greater than INR 5,000. or $100

Categories
General Hacks

Earn Money with Gopaisa – Indian’s cash back paying site

(Gopaisa.Com) Create Your Account And Earn Money with Gopaisa

Earn money with Gopaisa. That was founded by Aman jain and Sugam Jain in 2013, headquartered in New Delhi.

Companies tied up:

Gopaisa.com have tied up with 300+ top brand like  Jabong.com, Flipkat.com, Myntra.com, Shopping.Rediff.com, ShoppersStop.com, FutureBazaar.com, ShopClues.com, 100bestbuy.com, Shopping.indiatimes.com, Yebhi.com, Homeshop18.com, Infibeam.com, Provogue.com, Ebay.in, TataMcgrawhill.com, Amarchitrakatha.com, Bookadda.com, BiblioFreaks.com, Zovi.com, Inkfruit.com, LensKart.com, BagsKart.com, WatchKart.com, FashionandYou.com, FreeCultr.com, Helixwebstore.com, Basicslife.com, Funatic.in, Elitify.com, 99lens.com, Excluzy.com, Trendin.com, Indiarush.com, SaltnPepper.com, LadyBlush.com, Barcode91.com, Koovs.com, Bwitch.in, 21diamonds.com and many more.

Earn money with Gopaisa

You can earn cash back when you buy online from your favorite retailer via Gopaisa.com. When you will create your account , this site give you Rs.25 as a sign up bonus.  You can also earn Rs.50 if your referral earn Rs. 99 cash back.

Refer your friends to sign up

After sign up with gopaisa.com and confirming your email id. Log in your account. You will see your name at top right side of the website. Now click on your name, you can see a refer link. To get your refer link you should give your user name and your referral link look like” http://www.gopaisa.com/ref/mytechnode”.

Here mytechnode is my user name. When you will give a user name to your account, your referral link will be  www.gopaisa.com/ref/your user name. After getting your referral link, you will share this link through your social media account or sent this link to your friends email id. When any one sign up gopaisa.com via your referral link, you will see them at your referral account.

See your earning:

Click on your name then click on wallet you will see your account balance. You can get your balance  to your bank account through bank transfer or you can recharge your mobile or DTH with this balance or use it as an E- voucher.

How it work?

Every merchants and retailer need to advertise their product. They like to join favorite cash back site like gopaisa.com for spread their site. Online retailers provide commission to gopaisa.com when any one buy product from their favorite retailer via this site. Then it provide a certain percentage of commission to their members.

Why you should use this?

There is no joining fees to become member of this site. You can get sign up bonus just joining with this site. There are many option to use your account balance. You can either request for a check/ online bank transfer or redeem cash in your gopaisa.com account though mobile recharge, DTH recharge, Movie ticket, event ticket, shopping voucher etc.

Create Your Account And Earn Money with Gopaisa

Categories
How To ?

Compress 1GB to 1MB : How to Compress 1GB File to 1MB ?

Compress 1GB to 1MB : Save space in your PC and compress 1gb file to 1mb in simple steps. If you want to do this than follow given steps and enjoy free tricks.

Compress 1GB to 1MB:

Step 1) First of all you need to download a software to compress files that is KGB Archiver.
For Download Click Here

Step 2) So now install it in your computer.

Step 3) Choose an option to compress files and then click next.

Step 4) Select ‘archive type ‘ keep it as KGB and then maximum compression level.

Step 5)Then you have to select the files or file to compress.

NOTE: But there is one drawback of this .if you select maximum it will take more time to compress file just cause it compress file very slowly and with high compression rate.

Categories
Batch Programming C Programming General Hacks

Common Programming Mistakes to avoid in Every Language

Common Programming Mistakes: Learning to program can be tough–just ask anyone who’s done it! Fortunately, a lot of problems happen over and over again–I’ve put together 8 of the most common problems that you’ll run into as a new programmer.

Common Programming Mistakes

1. Undeclared Variables

int main()
{
  cin>>x;
  cout<<x;
}

“Huh? Why do I get an error?”

Your compiler doesn’t know what x means. You need to declare it as a variable.

int main()
{
  int x;
  cin>>x;
  cout<<x;
}

2. Uninitialised variables

int count;
while(count<100)
{
  cout<<count;
  count++;
}

“Why doesn’t my program enter the while loop?”

In C++ variables are not initialised to zero. In the above snippet of code, count could be any value in the range of int. It might, for example, be 586, and in that situation the while loop’s condition would never be true. Perhaps the output of the program would be to print the numbers from -1000 to 99. In that case, once again, the variable was assigned a memory location with garbage data that happened to evaluate to -1000.

Remember to initialise your variables.

3. Setting a variable to an uninitialised value

int a, b;
int sum=a+b;
cout<<"Enter two numbers to add: ";
cin>>a;
cin>>b;
cout<<"The sum is: "<<sum;
When Run:
Enter two numbers to add: 1 3
The sum is: -1393
"What's wrong with my program?"

Often beginning programmers believe that variables work like equations – if you assign a variable to equal the result of an operation on several other variables that whenever those variables change (a and b in this example), the value of the variable will change. In C++ assignment does not work this way: it’s a one shot deal. Once you assign a value to a variable, it’s that value until you reassign the values. In the example program, because a and b are not initialized, sum will equal an unknown random number, no matter what the user inputs.

To fix this error, move the addition step after the input line.

int a, b;
int sum;
cout<<"Enter two numbers to add: ";
cin>>b;
cin>>a;
sum=a+b;
cout<<"The sum is: "<<sum;

4. Using a single equal sign to check equality

char x='Y';
while(x='Y')
{
  //...
  cout<<"Continue? (Y/N)";
  cin>>x;
}

“Why doesn’t my loop ever end?”

If you use a single equal sign to check equality, your program will instead assign the value on the right side of the expression to the variable on the left hand side, and the result of this statement is the value assigned. In this case, the value is ‘Y’, which is treated as true. Therefore, the loop will never end. Use == to check for equality; furthermore, to avoid accidental assignment, put variables on the right hand side of the expression and you’ll get a compiler error if you accidentally use a single equal sign as you can’t assign a value to something that isn’t a variable.

char x='Y';
while('Y'==x)
{
  //...
  cout<<"Continue? (Y/N)";
  cin>>x;
}

5. Undeclared Functions

int main()
{
  menu();
}
void menu()
{
  //...
}
 "Why do I get an error about menu being unknown?"

The compiler doesn’t know what menu() stands for until you’ve told it, and if you wait until after using it to tell it that there’s a function named menu, it will get confused. Always remember to put either a prototype for the function or the entire definition of the function above the first time you use the function.

void menu();
int main()
{
  menu();
}
void menu()
{
  ...
}

6. Extra Semicolons

int x;
for(x=0; x<100; x++);
  cout<<x;

“Why does it output 100?”

You put in an extra semicolon. Remember, semicolons don’t go after if statements, loops, or function definitions. If you put one in any of those places, your program will function improperly.

int x;
for(x=0; x<100; x++)
  cout<<x;

7. Overstepping array boundaries

int array[10];
//...
for(int x=1; x<=10; x++)
  cout<<array[x];

“Why doesn’t it output the correct values?”

Arrays begin indexing at 0; they end indexing at length-1. For example, if you have a ten element array, the first element is at position zero and the last element is at position 9.

int array[10];
//...
for(int x=0; x<10; x++)
  cout<<array[x];

8. Misusing the && and || operators

int value;
do
{
  //...
  value=10;
}while(!(value==10) || !(value==20))

“Huh? Even though value is 10 the program loops. Why?”

Consider the only time the while loop condition could be false: both value==10 and value==20 would have to be true so that the negation of each would be false in order to make the || operation return false. In fact, the statement given above is a tautology; it is always true that value is not equal to 10 or not equal to 20 as it can’t be both values at once. Yet, if the intention is for the program only to loop if value has neither the value of ten nor the value of 20, it is necessary to use && : !(value==10) && !(value==20), which reads much more nicely: “if value is not equal to 10 and value is not equal to 20”, which means if value is some number other than ten or twenty (and therein is the mistake the programmer makes – he reads that it is when it is “this” or “that”, when he forgets that the “other than” applies to the entire statement “ten or twenty” and not to the two terms – “ten”, “twenty” – individually). A quick bit of boolean algebra will help you immensely: !(A || B) is the equivalent of !A && !B (Try it and see; you can read more about this rule on Wikipedia: DeMorgan’s Law). The sentence “value is other than [ten or twenty]” (brackets added to show grouping) is translatable to !(value==10 || value==20), and when you distribute the !, it becomes !(value==10) && !(value==20).

The proper way to rewrite the program:

int value;
do
{
  //...
  value=10;
}while(!(value==10) && !(value==20))

Categories
JavaScript

Autocomplete Textbox Using Jquery Integration Auto suggestion

Autocomplete Textbox Using Jquery : I am working on a project which need to do something like that user enter some letter and that will suggest data from database or some static array.

Bia research on google and many sites finally i got Jquery autocomplete to do this task easily.

Enables users to quickly find and select from a pre-populated list of values as they type, leveraging searching and filtering.

The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are tags for programming languages, give “ja” (for Java or JavaScript) a try.

<!doctype html> 
<html lang="en"> 
<head> 
<meta charset="utf-8"> 
<title>jQuery UI Autocomplete - Default functionality</title> 
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> 
<script src="//code.jquery.com/jquery-1.10.2.js"></script> 
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> 
<link rel="stylesheet" href="/resources/demos/style.css"> 
<script> 
$(function() { 
     var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme" ]; 
    $( "#tags" ).autocomplete({ source: availableTags }); 
});
 </script> 
</head> 
<body> 
<div class="ui-widget"> 
<label for="tags">Tags: </label> 
<input id="tags"> 
</div> 
</body> 
</html>

 

Reference: