Advertise here


Tag cloud


 

You are currently browsing the archives for the Web Development category.

Archive for the ‘Web Development’ Category

Remove link border when clicked

Posted on Thursday, October 28th, 2010 in Top Tips
CSS Top Tip

How to get rid of the dotted border around a link when it has been clicked.

a {
    outline: 0;
}

Stop auto complete on web forms

Posted on Thursday, October 21st, 2010 in Top Tips

On web forms the browser stores previously typed in data and if you start typing in the same data a dropdown list appears below with these options. Sometimes this can be annoying and gets in the way when you use the form regularly with unique data each time. To turn this function off on selected form elements use the following code:

<input type="text" value="test text" autocomplete="off" />

Use the attribute in the input element autocomplete with the value off to stop the drop down list appearing.


Conditional comments

Posted on Thursday, September 23rd, 2010 in Web Development

Using the HTML IF condition to load in the appropriate CSS for the client’s browser. Importantly the conditional comment only work for Internet Explorer, but can be used to detect the different versions. This is very useful because all of the IE browsers render CSS and HTML differently, which is why it can be so challenging make a site work the same across browsers. Read more


CSharp make MySQL variables work

Posted on Monday, August 30th, 2010 in MySQL

To get MySQL variables in c# to work you must put this text at the end of your connection string “Allow User Variables=True“. The reason this is turned off in the first place is because when c# parameters are used, they are identified by an ‘@‘ sign which conflicts with MySQL variables. But now you can use the ‘?‘ question mark to add parameters to the query string using the method AddWithValue(“?param”, paramVar);.

mysqlCommand.Parameters.AddWithValue("@lastestUrl", lastModified);

Assign row numbers and get rest of data according to row value

Posted on Saturday, August 28th, 2010 in MySQL

I recently found myself in a situation where I had to get data from MySQL database which had identical date-times but had text data in another column to uniquely identify a record. So I could use the combination to identify a unique record the problem was when appending a file with new records which had half of the records with the exact same date-times.

I constructed a query with some help to get the rest of the records from the last entry in the file. This is done by:

  1. Firstly getting data that is equal to and greater than the date-time in the text file.
  2. Then assign each row with a row number using MySQL variables @rownum:=@rownum+1 this is placed inside a sub query
  3. Then after the first sub query create a where statement where rownum is greater than the next sub query
  4. In the next sub query it will return the rownum the query should start from by running the same query as the first one but with a where clause identifying the the unique text.

You can use the query below for any instance where one column has exactly the same numbers which you need to order by with another uniquely identifiable column, so you know where you should start pulling from.

A clever use of SQL variables and sub queries.

Select x.column c
     FROM (select @rownum:=@rownum+1 as rownum, a.column
             FROM table a, (SELECT @rownum:=0) r
             WHERE a.datetime >= '2010-08-02 12:53:12' ORDER BY a.date ASC) x
where x.rownum > (Select x.rownum FROM
             (select @rownum:=@rownum+1 as rownum, a.text
             FROM table a, (SELECT @rownum:=0) r
             WHERE a.datetime >= '2010-08-02 12:53:12' ORDER BY a.date ASC) x
where x.text = 'unique-descriptive-text');

Web site performance

Posted on Tuesday, August 10th, 2010 in Web Development

Speedometer: Website PerformanceWeb performance is commonly overlooked especially when an e-business is just starting as they are trying to get up and running as quickly as possible. This is understandable but with a little forethought and planning at the start they could avoid complications developing at the time  they update their site. The main motivation behind website performance is Read more


Insert Ignore and Replace

Posted on Monday, July 26th, 2010 in MySQL

How the INSERT IGNORE works in MySQL: If a record exists in the table it will be ignored else a new row will be inserted. It works in the same way as INSERT IF NOT EXISTS. If the record has a slight difference then a new record will be added creating a duplicate record. Also if your table has a unique key of some kind an error will occur and the insert will be aborted.

To avoid duplications a better method is REPLACE INTO which replaces any data in any field that is not up to date. This prevents any duplicate records from appearing in the database. This overwrites the current records but if you don’t want this you are better off implementing some sort of version control. For instance when an article is edited, the updated version is inserted as a new record. Then you just use a date time stamp to identify the latest version. This does mean when there are a lot of edits the database will increase in size very quickly but its really easy to write a function that deletes old records.

Both INSERT IGNORE and REPLACE use the insert … values or insert … set syntax.


Five Free WYSIWYG web editors

Posted on Sunday, July 18th, 2010 in Web Development

The idea here is to be able to update your website or a client’s website quickly, efficiently and effectively without having to mess around with HTML code and CSS but with free web editing software. Lets say you lack the technical know how or the budget does not allow for the purchase of a good hosting package to install a Content Management System to update the site. If this is the case a good option is to look for a free web editor that can do the simple job of maintaining the web content. Read more



Web Design Essex | Richard Kotze – Web Technology, Design and Development powered by WordPress | Entries (RSS)