Topics Search

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

Fatal error: Call to a member function fetch_object() on a non-object
Views: 7
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:

More topics

 

Increase "memory_limit" value using php.ini

Preview
Sometimes your scripts will consume a lot of memory. Lack of it may cause in PHP throwing a fatal error with something like this below: Fatal error:
Allowed memory size of 134217728 bytes exhausted (tried to allocate 103 bytes).
The amount of bytes may be different but rest will be the same. To prevent it, you should increase value set in variable called “memory_limit”. You can do it in more than one way.
 

PHP Upload Function

Preview
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.
 

Functions

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

Introduction to PHP Exceptions

Preview
With the advent of PHP 5 came the new OO model and a new Object Oriented approach of dealing with errors. Exceptions give us much better handling of errors an allow us to customize the behavior of our scripts when an error (Exception) is encountered. Previously PHP dealt with errors by having error flags from functions and the trigger_error() function. These were well and good for pre-php5 days but in the new OO environment we need greater control.
 

PHP json_last_error() function

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

Complete advanced login member system

Preview
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

Preview
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

Preview
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

Preview
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

Preview
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.