OUTSOURCE. RELIABLY. Choose an engagement model that works for you:

GoodCore Software is a leading offshore software development company that offers reliable and cost effective software outsourcing options to its clientele world-wide.

Convert your idea into an Amazing Web Application!

From mobile app development to web application development to middleware and desktop software, we provide a wide range of offshore software development services.

Offering Reliable And Cost-Effective Offshore Outsourcing Options

Whether you are an IT consultancy firm looking to outsource software development or a small to mid sized business looking to leverage software technology for your business, we have the expertise to assist you..

Take Control Of Your Website:

How to Rescue Your Website from the Clutches of a Bad Web Designer or Bad Web Host.

Be a part of the revolution Launch Your Mobile App!

Skills with iPhone, iPad, Android apps - Beautiful and functional mobile UI designs - Native as well as HTML5 apps .

Friday 15 June 2012

Optimum PHP Database Connectivity - The PDO Way


Hypertext Processor or PHP, as it is more commonly known, has entranced the minds of developers worldwide. It is a general-purpose scripting language that can be embedded in HTML. One of the major advantages of PHP is its ability to talk with a variety of databases. This adds the much-needed interactive dimension to websites whereusers can fetch dynamic data and perform transactions. The heart of any web application is not its UI or its controller; it’s the database that stores and provides data based on the queries that are made to it. PHP, being a widely popular programming language, is adopted across the world by dedicated PHP programmers handling large-scale projects for firms providing PHP web development services. If you are one the countless offshore PHP developers who have handled database interactions, and still use the traditional PHP MySQL API for database connections, then this article is precisely targeted at you.

Did you know PHP offers 3 types of APIs for database connectivity? No? Well, here’s some information on them:

  1. MySQL – The most popular API which establishes database connectivity in the easiest of manners.
  2. MySQLi – An ‘Improved’ version of the MySQL API.
  3. PDO – PHP Data Objects, an API that is database agnostic and supports prepared statements, thus negating the requirement for SQL Injection.

Looking at the above points, some might say feel that MySQL seems to be the easiest way out, then why should we try anything else! Well, let us give you three reasons. Firstly, some of the commonly used MySQL API database connectivity code snippets are all set to be deprecated as they do not adhere to the best practices policy are not exactly the right learning that greenhorn developers should pick up. Second, if you need to escape user input, you need to specifically do it from the code, which can be a complex endeavor, especially if you are new to database connectivity and don’t have a clue about data sanitization. Third and the most important point; the MySQL API is inflexible which means you will come up a cropper if you decide to switch databases. Reason enough to consider PDO?

Remember the traditional way of connecting to a MySQL database:

# Connect

mysql_connect('localhost', 'username', 'password') or die('Could not connect: '. mysql_error());

Now consider the PDO technique where we create a new class instance, specify the driver, database name, username, and password:

$conn= newPDO('mysql:host=localhost;dbname=myDatabase', $username, $password);

The main advantage of this technique is that in the event of switching of databases, you can simply update the DSN. This reduces your dependency of MySQL and eliminates the absolute necessity of functions, such as mysql_connect.

But what about errors, you will ask! If the database connection is not established, how do we check the error? PDO offers 3 error mode options to deal with exceptions:

  1. PDO::ERRMODE_SILENT
  2. PDO::ERRMODE_WARNING
  3. PDO::ERRMODE_EXCEPTION

The default error mode is PDO::ERRMODE_SILENT, which does not throw up any exceptions. You must remember to change the default mode to PDO::ERRMODE_EXCEPTION which throws up exceptions as soon as they occur and stops the execution of the script. You can write a simple try-catch code block to capture these exceptions. Failure to do so will require you to manually fetch these non-captured errors.
Now comes the most important part, the core function; retrieving information from the database. This can be done using two options, query and execute. The query method involves using the PDO::Quote method to manually escape data and is almost similar to the mysql_real_escape_string. A word of advice here; if you are dealing with data that a user fills in to a form, use prepared statements instead. For any other data that is not form data, the query method is ideal.
Prepared statements are used via the prepare method that use named parameters, eliminating the need for SQL injection. These statements are then executed by passing data into the named placeholders. Now we come to the part of receiving the data that is fetched by prepared statements.

The PDO API provides multiple options to interact with the result. These include:

  • PDO::FETCH_ASSOC – default response, returns an array
  • PDO::FETCH_BOTH – returns an array, indexed by both column-name, and 0-indexed
  • PDO::FETCH_BOUND – returns TRUE and uses PHP variable for assignment of values in the columns
  • PDO::FETCH_CLASS – returns a new instance of the class used
  • PDO::FETCH_OBJ – returns an object that contains property names associated with columns

The PDO prepare extension is especially suited to the execution on the same query multiple times, each time with separate parameters. You can easily perform the common CRUD tasks that every PHP developer handles day in and day out. But the advantage that rises above all these features, is the usage of an object or class instance for mapping query results.  These inherent advantages should be proof enough for you to switch over from your old MySQL API to PDO. It will not only make your code more secure, but also streamline it to a great extent. And who can forget the coveted flexibility to switch over to any database! All of you, the PHP developer community including all offshore PHP developers, go PDO now, if you haven’t already!

We are GoodCore, a leading offshore software development company in Malaysia. Having garnered expertise in every cutting-edge web development technology that emerges in the market, we apply our skills to the conceptualization, development and deployment of clutter-breaking solutions for clients across the world. We ensure that our team of developers, programmers and consultants are on top of every new development in the technology arena and are primed to lend that advantage to your product. Over the years, we have gained the trust and credibility of many elite clients across the globe. We wish to extend the same quality of services to you. You can hire dedicated PHP developers from us who will help develop cost-effective solutions that match your requirements to the T. If you wish to develop state-of-the-art PHP solutions that are not just path-breaking, but also ROI-intensive, don’t hesitate to approach us. Our vast repertoire of talent is at your service!

Friday 1 June 2012

Single Page Application Development – The ASP.NET Way


Heard of Single Page Application framework? If you are into custom .NET development, we are sure you must have. The inherent advantages of a Single Page Application (SPA) make it a prime focus ASP.NET developers committed to the development of highly responsive web applications that are devoid of post backs and do not lead to page reloads. When you have applications that run like native apps on your machine the response times and the overall user experience are bound to be exceptional.

SPAs are similar to the applications that can be developed using the combination of AJAX and XMLHTTPRequest, or Iframe; but build on the shortcoming of these technologies by leveraging the ASP.NET MVC4 Beta framework. Using a parameterized URL for the definition of different operations that you wish to complete, Single Page Applications also use the history.js library. This means that not only is the state of the web page maintained, but also the browser back option functions normally and saves the state of the page. All this, in spite of the processes being rapidly executed on the client side! Additionally, SPAs work very well in tandem with HTML5’s advantageous features such as LocalStorage and Application Cache that are quintessential for the development of offline web applications.
Advantages of Single Page Applications:

  • Rich and interactive application development
  • Potent blend of template binding scripts, Data Model scripts, services, and data templates
  • Integration with LocalStorage and Application Cache features of HTML5
  • Simplified SPA development via ASP.NET MVC4 Beta framework
  • Rapid SPA development combined with an elegant UI

Further simplification is on its way, with the development of SPA Template Project nearing its completion. You can run the NuGet command line utility residing in the Package Manager Console available under the Tools menu and just type Install-Package SinglePageApplication.CSharp. The resulting template is quite enhanced and should offer seamless SPA development.

If you require custom .NET development services, approach GoodCore, an ASP.NET development company that prides itself on the development of path-breaking .NET solutions catering to a wide array of industry verticals and global businesses. Being a leading offshore software development company, GoodCore possesses a team of dedicated .NET developers primed to realize every .NET application development requirement. If you are looking out to hire dot net developers, look no further than GoodCore. We promise to deliver and exceed all your expectations!