0

I did some searching and saw people talking about looping the results because they can't be directly accessed as text, but all I'm calling with this query is 1 piece of information.

Here is the entire error screen that shows up......

MyBB has experienced an internal error and cannot continue.
Error Type:
Catchable Fatal Error (4096)

Error Message:  Object of class mysqli_result could not be converted to string
Location:  File: inc/functions_online.php

Code:

    $queryz = $db->query("SELECT location FROM mybb_testing8 WHERE uid='1'");
    echo $queryz; 

Backtrace:

File    Line    Function
/inc/class_error.php
    208
    errorHandler->output_error
/inc/functions_online.php
    1044
    errorHandler->error
/online.php
    242
    build_wol_row

......end of error screen......

I don't know if the "Backtrace" info above helps figuring this out or not. The command I'm trying to get to work is shown in the error above. What I want is to view the piece of information that's in the "location" column for user 1 in the mybb_testing8 table. How do I do that? Can somebody help me understand why this is not working, in the simplest terms possible for somebody who is VERY new to this? Also, can somebody convert the coding to a workable version?

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • this $queryz is object and u cant echo this at best print_r() to see whats in there !! – Abhik Chakraborty Mar 28 '14 at 14:03
  • When I print it like that, it tells me this: **ignormysqli_result Object ( [current_field] => 0 [field_count] => 1 [lengths] => [num_rows] => 1 [type] => 0 )** ...but what I want is to view the piece of information that's in the "location" column for user 1 in the mybb_testing8 table. How do I do that? – user3472856 Mar 28 '14 at 14:08
  • yes its an object now u need to fetch the data to get the values @@ check in your DB class for related methods to do so. – Abhik Chakraborty Mar 28 '14 at 14:09
  • I guess I just don't understand the terminology. What do I physically do in order to "check in my DB class for related methods"? Please explain more specifically as I am very new to PHP and SQL. I have not had any schooling on this at all; my apologies. – user3472856 Mar 28 '14 at 14:17

0 Answers0