CancelImage Upload

Topics: MySQL
Read our latest entries.
Posted by Garren Harland on July 27, 2009, 10:03 pm.
Pre formatting your data at the select stage can save you a lot of time spent on editing and fine tuning. A frequent requirement in this sense is to convert a string into lower case. Here then is how it is done in MySQL.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 7:46 pm.
If this is news to you, yes, indeed, it is possible to round your numbers to a specified decimal point within a MySQL query statement. No need to use any PHP round functions afterwards, simply enjoy the results the MySQL query gives you.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 3:54 pm.
If you are looking for a way to join two fields together and through doing so creating one variable, AS is the solution. Lets use the example of joining first and last name from individual fields of a table together into becoming one simple name. Here is how it would be done.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 3:21 pm.
To perform calculations in MySQL we have to define a new (temporary) row for the results. This does not mean you have to change your table structure, instead we will dynamically generate a row on the fly, that will only be physically available in the output, not in the table it self.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 2:50 pm.
Lets assume your boss has asked you to provide the number of employees in your organisation in each of the salary categories where more than 5 employees are present. Now while finding out how many employees are in each of the salary categories is pretty straightforward.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 2:20 pm.
Here is how you can output the total sum of specific column values added up. Let's say for instance that we had an employee database, and our boss wanted to know the total sick days that had been taken off by all employees put together. Here then is how we would accomplish this task, by adding up all the individual number of sick days.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 1:55 pm.
By using count() in MySQL we can establish how many rows lie within a specified range, or fulfil a certain set of conditions.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 1:31 pm.
Establishing the smallest or largest field number within a table in MySQL requires the use of MIN() or MAX(). Within the brackets you can define the field you wish to find the largest or smallest values of. Here then is how we would find the winner and loser from a table called sportResults.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 1:14 pm.
Thanks to phpmyadmin a lot of us programmers have become spoilt. Sure we know how to put together the most complex select statements in the world, but at the cost of the simpler things. Such as creating a MySQL Table via code. Oh the horror!
Click here to read on.
Posted by Garren Harland on July 27, 2009, 12:48 pm.
Let us say you had a table called users and you wanted to put together a select statement for specifically those whose IDs fell in the rang between 30 and 40. Now most programmers would in this case resort to greater and smaller than operators.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 12:09 pm.
To make use of certain MySQL functions your tables need to be of the correct type. For a MySQL MATCH() statement to work for example, you will need table to be of the type MyISAM before it can be searched.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 11:56 am.
If you are looking to build a search engine like function for your MySQL Database then learning how to utilize MATCH() will be a step in the right direction. Match will return results with your specified keywords along with ordering them by occurrences.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 11:52 am.
Previously I have discussed how one can use a SELECT WHERE LIKE statement in combination with Wildcards to find the appropriate results of a table based on a keyword search. The next step of course is to not only find the rows that are deemed suitable enough to be included among the results, but to also order these based on the occurrences of the keywords.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 11:50 am.
In MySQL you might not always be able to perform a select where you know the exact name of the entity you are looking for. Let us say for instance you have a sport articles table, and want to return every article that contains the keywords Michael, Jordan and Basketball.
Click here to read on.
Posted by Garren Harland on July 26, 2009, 9:10 pm.
Returning the average value from the table of a field in PHP is a piece of cake. First we need the correct SQL statement, specifying the field of which we require an average. In this example we want the average score from a table called players.
Click here to read on.
Posted by Garren Harland on July 26, 2009, 8:12 pm.
The most straight forward way to ensure your MySQL search results only have unique values is by using a distinct select query. The structure of a query using distinct is slightly different when compared to a standard select argument.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 12:26 pm.
If you are reading this I will assume that you are trying to access a MySQL Server from a remote host. Furthermore your remote server and your MySQL Server are not much in the mood for dancing, and no matter what you try you are confronted with this annoying error message.
Click here to read on.
Posted by Garren Harland on July 16, 2009, 4:08 pm.
Before menacing users can be blocked their IP-Address needs to be captured and monitored. Here is one way to do so. Create a table called visitors into which you can store IP-Addresses.
Click here to read on.
Posted by Garren Harland on July 12, 2009, 7:29 pm.
Connecting with and utilising a MySQL Database that is located on a different Server requires the same function with which connections are usually established in PHP: mysql_connect() (or mysql_pconnect).
Click here to read on.
Posted by Garren Harland on July 1, 2009, 11:01 pm.
If you are working with PHP and MySQL, sooner or later you will no doubt require the id of an item you have just inserted into a table. Now, instead of having to perform an elaborate select statement to acquire the inserted items ID, there is a far more elegant solution.
Click here to read on.
Posted by Garren Harland on June 29, 2009, 12:27 pm.
Now while some might still be reading the title and asking themselves why on earth anyone would want to use PHP to gather data from a Microsoft Access Database, in the real world this type of functionality does make sense. Not using Access as a Database for a website of course. But it could well be that a company has stored a lot of data locally on an Access Database, and that the data is needed for the company's new website. Any programmer faced with this kind of task will thank his lucky stars that PHP is capable of hooking up with an Access database, and through this can load the data in question over to a MySQL, or other, more suitable database.
Click here to read on.
Posted by Garren Harland on June 27, 2009, 11:53 am.
When converting and manipulating data, whitespaces play an important role. Especially databases can fill up fields with the required number of empty spaces, which can lead to undesired effects in regard to sort functions. This is why the following three functions are of particular high value.
Click here to read on.
myDesignTool Networking • www.mydesigntool.cominfo@mydesigntool.com