delete
JavaScript Confirm Action Dialog
Wed, 09/02/2009 - 19:34 | by philipnorton42If you want to create a link that performs an action that can't be rolled back then you might want to stop the user from clicking that link unless they really want to. The best way to do this is to intercept the link with a confirm() command.
The first way to do this (and especially useful if you want to ad other functionality) is to use the following function.
Deleting Directories With Phing
Tue, 01/13/2009 - 16:14 | by philipnorton42Although using Phing is mainly about copying files, you might also need to delete directories and files using the delete element. Remember that the default behavior of copy command copies files only if the source files are different from the destination files. A prudent approach might be to delete the build directory and then recreate it, ready for Phing to copy files into.
Function To Delete Temporary Files
Tue, 05/13/2008 - 08:50 | by philipnorton42If you allow users to upload data to your site you might have a situation where a data directory might be full of temporary files. In the long term you will want to get rid of these files as they have served their purpose and are no longer needed.
Delete File By inode Reference
Fri, 05/09/2008 - 08:39 | by philipnorton42If you want to delete a file that you can't type in the name of either because the name is long and complicated, or because it is difficult to type in without causing a syntax error then here is the solution.
You first need to find the inode reference of the file. This can be done by using the command ls -li. The start of each line has a number that is specific to that file. You could use the command ls -i , but the output is a little confusing.
Finding Duplicate Values In A MySQL Table
Wed, 02/06/2008 - 16:31 | by philipnorton42To find duplicate values you need to use the MySQL COUNT() function and then pick out all of the counts that are greater than one.
SELECT value,COUNT(value) AS Count FROM test GROUP BY value HAVING (COUNT(value) > 1) ORDER BY Count DESC;
Conversely you can also select the rows that only have a single entry.