Performing an SQL query in oxid

I am fairly new to OXID.

I am trying to perform an SQL query by using OXID functions only.

The point is to check if $discount exists in oxVoucherSerie’s table oxdiscount, and if it exists get the oxid from oxVoucherSerie that corresponds to that discount.

Sadly I cannot use plain MySQL and I am only allowed to use oxid functions. I have no idea how to do it.

    public function save_voucher($discount){
$o_voucherid         = oxNew("oxVoucherSerie");
$aWhere_discount['oxdiscount']    = $discount;
$sSql                       = $o_voucherid->buildSelectString($aWhere_discount);
$b_exists                   = $o_voucher->assignRecord($sSql);
}

This tells me if the discount exists. However, I have no idea to retrieve oxid from said discount.

since we have already started on stack overflow, I have answered you question there:


but we can continue here, if you want

[QUOTE=vanilla thunder;180250]since we have already started on stack overflow, I have answered you question there:


but we can continue here, if you want[/QUOTE]

Thanks. Stack overwflow won’t show when someone updates an answer, so I didn’t check the question until today.