A.imahrap A.imahrap - 11 months ago 31
PHP Question

how can i select this item in array?

Hello i made this query for wordpress plugin

$anyOne = $wpdb->get_results("SELECT MAX(id) as idlastest FROM " . $table_name_for_select . " WHERE drJlDate='".$dkdrbooking_for_compare."'");

the value in

Array ( [0] => stdClass Object ( [idlastest] => 32 ) )

I need to get 32 to use it in another query, but i can't select that. How can I get
from this array ?
I tried this code, but it didn't work

echo 'lastestID is : '.$myIds[0]['idlastest'];


This is an object in your array, so use -> to get object value

echo 'lastestID is : '.$myIds[0]->idlastest;