Subscribe To Our Newsletter

Sign Up Now To Get Free Coupon Codes, Event Coupon Codes Updates, Offers Updates. It's 100% Free!

We Hate Spam! Really, It's terrible and we never do it.

MySQL Error : Unknown column 'id' in 'where clause' error in PHP

Sometime you get MySQL Error like
Error Number: 1052

Column 'id' in order clause is ambiguous
This is just because of some misunderstanding about MySQL queries. This error occurs, when you try to search same column, which exists in two tables. For it, you need to write proper query that you can use in MySQL.
Try to follow some rules........
  1. When you write any query, must sure that you have checked that in PHPMyAdmin > SQL
  2. If you need to use variables in MySQL query, Try to use concatenation for that variable like:
     $query = "select * from users where name = " . $username[2];  
    
  3. Try to avoid special characters in MySQL query.
  4. Try to use updated PHP5.5.x functions. 
  5. Make sure that your order sequence is correct.
  6. Again must check that every query is working correct in Local Host.
  7. Try to take attention on "Order by", "Limit", "Rand", "Atoms" functions
  8. Use mysql_real_escape_string() function with variables to avoid hacking.
Share this article :

Post a Comment

Give your reviews about this blog. Leave your comments. what do you think about this post?

Meet Samee Ullah Feroz On Google Plus
Comments Description is given below:
1) I love to read comments, but do not spam.
2) Like this blog and also tweet its posts.
3) You can use some xHTML tags.
4) All Comments are Do Follow, Please try to use blog professionally.
5) Mention Your Name below the comment.
6) You can also suggest for improvement.
7) Do not forget to subscribe Samee Articles blog.

---------------------------------------
Thanks for visiting QWC.Me.
==========================================
For free guidelines contact me on SEO Expert | Samee Ullah Feroz is online there.
==========================================
Best Regards

 
Support : | Internet Marketing Specialist And Business Developer
Copyright © 2013-2016. Samee Articles - All Rights Reserved
Proudly powered by Blogger