小编Kri*_*511的帖子

LINQ中等效的等价物

我正在寻找以下查询的LINQ等价物

Select * from ct_rate
WHERE
'2010-10-01 00:00:00'
BETWEEN start_date and end_date;
Run Code Online (Sandbox Code Playgroud)

任何的想法?

linq

2
推荐指数
1
解决办法
639
查看次数

在Select - FORM API Drupal中显示数组

我想添加键(type_id)和值(type_description)以在drupal表单API中进行选择

$ result_x-> product_types-> RPMProductType是来自数据库的数组结果: - array(4){[0] => object(stdClass)#18(2){["type_description"] => string(10)"Calendered"[ "type_id"] => int(1)} [1] => object(stdClass)#19(2){["type_description"] => string(8)"Extruded"["type_id"] => int(2 )} [2] => object(stdClass)#20(2){["type_description"] => string(6)"Molded"["type_id"] => int(3)} [3] => object( stdClass)#21(2){["type_description"] => string(5)"Other"["type_id"] => int(4)}}

foreach ($result_x->product_types->RPMProductType as $data)
{

$form['manufacturer_add_new_sales']['product_type'] = array(
    '#type' => 'select',
    '#title' => t('Product Type'),
    '#options'=>array($data->type_id=>$data->type_description),
    );
}

什么时候这样做我只得到最后一个值,即其他.如何正确循环绑定选择以显示所有数组键 - 值.

先感谢您.

php drupal drupal-fapi

0
推荐指数
1
解决办法
3248
查看次数

标签 统计

drupal ×1

drupal-fapi ×1

linq ×1

php ×1