Setting up a database connection can be a difficult task. Search Google and the scripts you will find will amaze you. These are lengthy and boring. Here is the easy most method to create a dbconnection for PHP and mysql.
Ever encountered with this WordPress MySQL error? MySQL Server Has Gone Away. And then your blog sidebars will refuse to show posts links, tags, recent posts, recent comments etc. I got this problem over and over again and I thought that I was using heavy plugins and MySQL query was timed out being very long. I searched for some solution but just found this answer that if I will use long query, MySQL server will be timed out and will be gone away. Funny!!! But I was hesitating to use more plugins and actually using limited options and other limits in existing WordPress plugins in my blog.
Did you wonder sometimes that why mySQL Update Command do not update records when the syntax of update query is perfectly alright? This is the problem I stuck with couple of times and I just wondered and looked for solution but seriously never found any solution to that anywhere untill I found the answer to this question and I was relieved.
WHERE command is used to collect the records from the table based on some condition specified by the where clause. More than one condition can be added to the where clause by using various logical expressions like AND, OR, < ( less than ), >(greater than) etc. Logical expressions plays important role in returning the desired records. Let us start with some examples. We are interested in the marks of Fourth class students. You can just follow the table creation process and the select query section discussed here. We will use the table named as student to work with WHERE clause.
Table structure can be changed by using alter command. With this command Field type or property can be changed or a new field can be added. If you decide to change a field to UNIQUE so it will not accept any duplicate records then if some records with duplicate value are already there then system will not allow this. Same way we have to take care of other constraints.
A primary key is used to uniquely identify each row in a table. It can either be part of the actual record itself, or it can be an artificial field (one that has nothing to do with the actual record). A primary key can consist of one or more fields on a table. When multiple fields are used as a primary key, they are called a composite key.