CodeIgniter Documentation News Tutorial Follow-on – Adding the Ability to Edit

The official CodeIgniter documentation contains a useful tutorial on how to use CodeIgniter to create a news section on a website. Unfortunately the tutorial only shows you how to list news, view individual news posts and create new news posts. In this tutorial I will be showing how to extend this code to include the ability to edit news. I’m assuming you are using CodeIgniter 2.1 and have followed the tutorials for static pages, news section and create news items.

Model – news_model.php

Updates to the news model are pretty straight forward, we take the set_news() method and duplicate it. We need to know which article is being edited so we pass through the ID. This is then used with the CI database class to add a WHERE clause to the SQL before sending the UPDATE query to the database.

Continue reading

Getting Started with Augmented Reality

Augmented Reality (AR) is taking over were virtual reality has been failing over the years – except this time it’s different. The biggest failing with virtual reality is the simple fact that it is too discontented from, well, reality. Step in augmented reality. Augmented reality is already breaking through in to mainstream society and has been for a few years; star viewing apps, Layar and Wikitude are all extremely popular on various smart phone platforms.

An ever increasing presence of smart phones in consumers’ pockets and a slow realisation from marketing departments that using technology to advertise and enhance the customer experience is a good thing is opening the gates for all sorts of ideas and innovations. As a tech-savvy consumer you can now order and pay for your pizza at the table or walk in to a store and get instantly notified of the latest offers.

Continue reading

Common Logic Checks in PHP from a Classic ASP Perspective

Ask anyone who has ever written code in different languages and they will tell you; once you’ve learnt one language you’ve learnt them all. That’s not to say learning one makes you fluent in all – far from it, even the most similar of languages have different enough to cause headaches – but for each programming language you learn, the next becomes easier. This is because at the heart of every language are two basic functions; logic checks and loops.

In this post I will be covering how to get your head around the most common logic checks in PHP when moving from a Classic ASP background – something that I have done recently. First on the agenda is the most basic of logic checks – the IF statement, which in plain English translates to if this statement is true, do this, otherwise do this.
Continue reading

Full stack PHP Web Developer – Bedfordshire