View Single Post
  #1 (permalink)  
Old September 13th, 2012, 12:23 AM
MRGLENN MRGLENN is offline
Registered User
Points: 43, Level: 1
Points: 43, Level: 1 Points: 43, Level: 1 Points: 43, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2012
Posts: 7
Thanks: 1
Thanked 1 Time in 1 Post
Default Errors LESSON CS 28 & 29 FINAL

Downloaded Code on Lessons 28 and
Made The Changes Recomended in Thread about Errors, on Lesson 28 .

The 'contact' Table is Showing all users & Passwords after running install.sql

I. Getting this Error after Entering Login: User ID 'msmith' & Password 1234

which Reports a Error at Line 422 at File: contact.php

HERE IS THE STACK-TRACE


( ! ) Fatal error: Call to a member function fetch_array() on a non-object in C:\xampp\htdocs\php24\lesson28csfinal\includes\cla sses\contact.php on line 422
Call Stack
# Time Memory Function Location
1 0.0015 340184 {main}( ) ..\index.php:0
2 0.0026 384272 require_once( 'C:\xampp\htdocs\php24\lesson28csfinal\includes\in it.php' ) ..\index.php:13
3 0.0569 464048 userLogin( ) ..\init.php:32
4 0.0725 572320 Contact::logIn( array(2) ) ..\functions.php:223
5 0.1051 591168 Contact::getContactIdByUser( string(6) ) ..\contact.php:488


The Error Seems to Be at This Line ..... in: contact.php


while($result = $result_obj->fetch_array(MYSQLI_ASSOC)) {
$id = $result['id'];
}


I Placed a echo Statement To Display the $result_obj & $query.... My Line may be different Here as I added Comments

To Show the Variable $result_obj & $query ....It Appears to Be Empty for $result_obj

The $query appears Correct ....Shown Below


OUTPUT:
Just Before Line 424 in contact.php...result_Obj: query: SELECT id FROM `contacts` WHERE user_name="msmith" LIMIT 1


It Appears this is Causing the Error . It Cant Locate=> fetch_array () with the

Ptr result_object being a Null.


Q: Could you Recommend How To Correct Errors HERE in Lesson 28-29cs Final Solutions ?
Reply With Quote