[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
mv_data_function == update, problem
List :
I gave up on the mv_data_function delete. I figured I could get "update" to
work since I had an example in the manual. I constructed the following code to
update the field coupon in the database students
[if data students::coupon::[value student_id] =~ /25/i]
<!-- Checks to see if the student has a value of 25 in their coupon. Hopefully
I can make it so once the coupon has been used, the value in the field "coupon"
can be updated to "0" making the coupon useless after one use (my goal.)
<FORM METHOD="POST" ACTION="[process-target]">
<INPUT TYPE="HIDDEN" NAME="mv_data_table" VALUE="students">
<!-- the database is called students and is declared as
Database students students.asc 1
in catalog.cfg -->
<INPUT TYPE="HIDDEN" NAME="mv_data_key" VALUE="code">
<!-- The database I'm using looks like this :
code student_id coupon
000001 000001 25
and is tab delimited. -->
<INPUT TYPE="HIDDEN" NAME="mv_data_function" VALUE="update">
<!-- I want to update the value of "coupon" to 0 if it is set @ 25 at the
begining of the conditional. -->
<INPUT TYPE="HIDDEN" NAME="mv_data_fields" VALUE="coupon">
<!-- This variable is what the docs indicate is used to decide what fields to
update / insert. -->
<INPUT TYPE="TEXT" SIZE=3 NAME="coupon" VALUE="0">
<!-- The docs have a loop here, which I can't get to work at all. If I put in
the [new] tag, the conditional "[if data students::cou...]" stops working and
the [else] section is displayed. This happens if i put the [new] tag anywhere
on the page. I'm using MV 3.10. I checked the MV 3.10 docs and it indicates
the same syntax (or very close. This seemed to be the correct way to do it,
but I'm really really confused, so it is probably where I'm going wrong. If
anyone knows what I should be doing, don't hesitate to tell me ;) -->
<INPUT TYPE="HIDDEN" NAME="mv_nextpage" VALUE="donewithup.html">
<!-- This is the page that does the [tag export]students[/tag]. Both of these
pages (the one I'm disecting and donewithup.html have the [tag flag write]
students[/tag] in them. -->
<INPUT TYPE="HIDDEN" NAME="mv_todo" VALUE="set">
<INPUT TYPE="submit" VALUE="Update Table">
<!-- The syntax in the 3.10 docs and the 3.12 or 3.14 docs is a little
different, but I've tried them both to no avail. -->
I hope this is enough information to help someone see what little mistake I've
made (or huge mistake I've made ;))
thank you for your time and help,
ps: here is my stuff minus comments :
<HTML>
<HEAD>
<TITLE>FUK</TITLE>
</HEAD>
[if data students::coupon::[value student_id] =~ /25/i]
<FORM METHOD="POST" ACTION="[process-target]">
<INPUT TYPE="HIDDEN" NAME="mv_data_table" VALUE="students">
<INPUT TYPE="HIDDEN" NAME="mv_data_key" VALUE="code">
<INPUT TYPE="HIDDEN" NAME="mv_data_function" VALUE="update">
<INPUT TYPE="HIDDEN" NAME="mv_data_fields" VALUE="coupon">
<INPUT TYPE="TEXT" SIZE=3 NAME="coupon" VALUE="0">
<INPUT TYPE="HIDDEN" NAME="mv_nextpage" VALUE="donewithup.html">
<INPUT TYPE=SUBMIT name="mv_todo" Value="Set">
</FORM>
[else]
this isn't working now cory! work harder!
[/else]
[/if]
========================================
Cory Trese
email : digital@specialty-books.com
phone : (740) 594 - 2274, ext 223
phax : (740) 593 - 3045
========================================
Mail Sent from
Specialty Books,
Athens Ohio, 45701
www.specialty-books.com
RedHat Linux, Hedwig
P][ / 2.3.5
========================================