Fatal error: Call to a member function fetch_object() on a non-object

When coding, it is always advisable you check code to make sure the syntax are correct as majority of bugs arises from it. If you are using an Integrated development environment (IDE) such as NetBeans, Dreamweaver or Aptana Studio, you are notified when there is (syntax) error in your code. While working on a CMS I was building for a client, I encountered this PHP / MySQL error;

Sponsored Links:

Related Topics

PHP Upload Function
Uploading a file using PHP is not a single step function. To make this easier, I have created a function that will upload a file with just one function call. Just upload('image'); and the file is uploaded! upload() is a function that makes uploading files very easy.

Learn how to define your own function and how to call a function. You'll also learn the variable scope.

PHP json_last_error() function
While working on encoding or decoding JSON, if an error occurres, json_last_error() function returns the last error.

Complete advanced login member system
this advanced tutorial will teach you the steps required to create a custom build login/member system with PHP.

PHP Array Length using count or sizeof
PHP Array Length can be measured by using either count function or sizeof function in php. both functions will work same, sizeof function is an alias of count function. By using this count function in PHP, you can measure PHP Array Length. Counts all elements in an array, or something in an object and returns numeric value. It takes two argument, first argument is the array and it is required.

Object Oriented Programming
This tutorial covers the following:
* The drawbacks to standard function libraries and how object-oriented programming helps to solve them
* How to declare, implement, and use classes in PHP5
* How to extend classes
* How to create hierarchies of related classes that share implementation and classes that expose common programming 'interfaces'
* Some of the other details and features of classes in PHP

Debugging PHP: Did You Remember to
So you've finally managed to install PHP. Anxious to use your new tool, you find the print function in the manual, write your own hello world, load the page and the dreaded "Parse error: parse error in /usr/local/apache/htdocs/test.php on line 2" error pops up in front of you. You know the scenario, read on to learn the fixes....

Object Oriented Programming With PHP
First off, an object (also know as a class) is a very simple section of code that has a section of its own variables and functions. In a simple way an object is kind of like a program itself. Objects can be used for many different things as they are very expandable. What an object is capable of doing is entirely up to the developer. A class can be used for things as simple as creating a link and or to store data loaded from a file and or SQL query.

Object-Oriented PHP for Absolute Beginners
This tutorial introduces you to object-oriented programming in PHP. You'll explore the basics of object-oriented programming, and learn how to write simple object-oriented PHP scripts.

Copying an object in PHP with clone
Objects in PHP are assigned by reference, so copying an object with the = operator will result in a second variable referencing the same object and not an actual copy.

PHP Function
When you have a set of variables or want to make your code simpler, you will use a function. Creating a function is really easy.

PHP Date Function Hints and Tips
We are going to learn how to use the PHP Date function. It really is a simple function, but there are a lot of parameters that can be used which may make it harder for people to catch on to right away. I hope that with this tutorial, it will make the function a little easier to understand by providing visual examples.

Passing Data
The usefulness of functions is greatly enhanced by the ability to pass information from the main body of code to the function and in the opposite direction, or between one function and another it is calling Values that are sent to a function are called arguments.

Sending queries to mySQL
PHP send quesries to mySQL using mysql_query function. mysql_query function returns boolean (True or False) value which your quesry does not return any records. Queries (sql statements) like SELECT, SHOW, DESCRIBE, EXPLAIN return false value on error. If query is true, returning value must pass to mysql_fetch_array().

Learning Functions
A function is a block of code which can be called from any point in a script after it has been declared. It is basically a compartmentalized PHP script designed to accomplish a single task. Furthermore, code contained within functions is ignored until the function is called from another part in the script. Functions are useful because they contribute to rapid, reliable, error-reducing coding, and increase legibility by tiding up complicated code sequences.

Functions, Classes and Objects
In this tutorial i will guide you through the evolution of some php code as it passes from being a function through a static class and finally end up as an object. there is plenty more i could share with you on the theory behind objects, but all we are looking at here is giving you the understanding you need to be able to go out and write your own classes.

Recursion in PHP
A recursive function is just a function that calls itself. In order to make a recursive function not explode all over itself, though, it is important to keep some ideas in mind.

Currency Format Tutorial
In this tutorial we use the money_format function which is part of the STL in PHP. This function wraps the C library function strfmon() and is only available on Unix/Linux systems. Windows users should use number_format()

Classes and OOP in PHP
Object orientated programming (OOP) is a commonly used term when discussing modern programming techniques. One of the things that makes humans stand out is the ability to categorise - we put objects into categories of similar type of function.

Functions, Cont.
The usefulness of functions is greatly enhanced by the ability to pass information from the main body of code to the function and in the opposite direction, or between one function and another it is calling Values that are sent to a function are called arguments.