I am having a problem with PHP at the moment, I am getting this error,
Object of class stdClass could not be converted to string the error occurs when
In General to get rid of
Object of class stdClass could not be converted to string.
try to use echo ' for my SQL Query got the result as '; print_r($sql_query);
stdClass Object
(
[num_rows] => 1
[row] => Array
(
[option_id] => 2
[type] => select
[sort_order] => 0
)
[rows] => Array
(
[0] => Array
(
[option_id] => 2
[type] => select
[sort_order] => 0
)
)
)
In order to acces there are different methods E.g.: num_rows, row, rows
echo $query2->row['option_id'];
Will give the result as 2