I’m quickly going to demonstrate how to escape special characters in a string for all POST/GET variables safe for a MySQL INSERT query when passing values from a HTML form. So, let’s say we have a form like this on index.php: Details First Name: Surname: Email: View Code HTML1 2 3 4 5 6 7 [...]
Maruf scribbled this post.
I’m quickly going to demonstrate how to INSERT rows from one table into another table. I’d just like to clarify, this isn’t the same as completely copying a table, because with a INSERT SELECT query you can use the WHERE clause to INSERT rows with a particular condition (e.g. WHERE name = ‘Bill’). Whereas, copying [...]
Maruf scribbled this post.
I’ve been working with meduim sized tables (2.1million rows) in MySQL lately. One particular table had a lot of duplicate rows, which I needed to filter out. I’m quickly going to demonstrate how I did it. I’m sure there are many ways of doing this, but this method proved to be the easiest for me. [...]
Maruf scribbled this post.
Here’s a simple pierce of code which will permanently redirect a folder / directory. For example, if you have a directory in the following path: http://www.example.com/pictures/, and for whatever reason decide to rename the directory to http://www.example.com/new-pictures/, the following htaccess code will safely redirect all users from /pictures/ to /new-pictures/ Redirect An Entire Directory / [...]
Maruf scribbled this post.
This is a very specific problem I was faced with a few days ago, so I doubt many people will find it directly useful. However, the solution to this problem can be used to resolve a load of tricky regular expression issues. The Scenerio A client recently changed permalink structures for his entire website. For [...]
Maruf scribbled this post.
My God, I’ve only just recently started playing around with SM Forums, and I can honestly say the documentation is God awful. At least, it’s terrible compared to WordPress. Also, it’s not coded that great- even applying the simpliest of features require plugins (“mods”, as the SMF community call them) and/or hacks. Anyways, in this [...]
Maruf scribbled this post.
This is one of those posts that is purely a reminder for myself. It’s something so simple, but for some reason or another, I tend to forget. Suppose I have a loop, and I want to call a certain action on every 5th loop. For example, on the 5th, 10th, 15th..etc count, I want to [...]
Maruf scribbled this post.
I’ve been playing around with Google Adsense a lot lately- in particular trying to find out where the ads are best placed on a WordPress Blog to maximise click through rates (CTR). I’ve been looking at some wordpress plugins, but I couldn’t find any that allowed me to display an ad unit after the first [...]
Maruf scribbled this post.