【发布时间】:2016-07-27 06:44:55
【问题描述】:
你好,我为 wordpress 插件做了这个查询
$anyOne = $wpdb->get_results("SELECT MAX(id) as idlastest FROM " . $table_name_for_select . " WHERE drJlDate='".$dkdrbooking_for_compare."'");
$anyOne 中的值为
Array ( [0] => stdClass Object ( [idlastest] => 32 ) )
我需要获得 32 才能在另一个查询中使用它,但我无法选择它。我怎样才能从这个数组中得到idlastest?
我试过这个代码,但它没有工作
echo 'lastestID is : '.$myIds[0]['idlastest'];
【问题讨论】:
-
试试 $myIds[0]->idlastest
-
stackoverflow.com/questions/5156841/… 在这里,希望对您有所帮助。
-
@Danielius tnx 这么多
-
@sozkul tnx 这么多