PDA

View Full Version : Miva noob question - mvopen, mvfind, mvevaluate


zslates
08-28-08, 02:10 AM
I'm trying to just pull a record from a database (coupon database) and display it. I can connect and pull a record from the db but its never the right one.

I'm trying to get the ID of "bags07" and just for error checking I output the ID to see if I have the right record. The ID from the db comes out as "10SITEWIDE"....not the bags07....

CODE:
<mvopen name="opendb" database="...test/couponrd.dbf"
indexes="...test/couponrd.mvx" TYPE="xbase3" >

<MvASSIGN NAME="variable1" VALUE="bags07">

<MvFIND name="opendb" VALUE ="{variable1}" EXACT="Exact">

<MvASSIGN NAME="g.stuff" VALUE="{opendb.d.ID $ ' ' $ opendb.d.VALUE}">

<MvCLOSE NAME = "opendb">

<MvEVAL EXPR="{stuff}">

<!--- Results in "10SITEWIDE 10.00" -->

What am I doing wrong?

PS I tried Mvfilter, but i have the same problem as above, just with a different coupon id.

Thanks in advance.

wcw
08-28-08, 02:19 AM
The ID should be saved in the database as upper case. Look for BAGS07

zslates
08-28-08, 02:31 AM
YOU the MAN Weiland...THX!!

PS...its strange to me that it returned something at all.

wcw
08-28-08, 02:35 AM
Probably the first record in the file, ie the pointer did not move.