Field Name+Variable question
Posted: Wed May 11, 2011 3:03 pm
Sorry - sorta PHP noob.
Easy to do in Coldfusion. Haven't figured out in PHP yet.
I've a number of database field names:
parf_50
parf_100
parf_150
Let's assume "myVAR" equals 150. In Coldfusion I can call that specific field by doing:
fieldVALUE = #Form["parf_#myVAR#"]#
or by using "evaluate" (best practice is to avoid "evaluate" though...)
fieldVALUE = Evaluate("form.parf_[#myVAR#]")
What's the best way to do this in PHP?
I've tried goofy stuff (?) like: $_POST["parf_+$myVAR"] but so far, nothing seems to work for me.
TIA.
Easy to do in Coldfusion. Haven't figured out in PHP yet.
I've a number of database field names:
parf_50
parf_100
parf_150
Let's assume "myVAR" equals 150. In Coldfusion I can call that specific field by doing:
fieldVALUE = #Form["parf_#myVAR#"]#
or by using "evaluate" (best practice is to avoid "evaluate" though...)
fieldVALUE = Evaluate("form.parf_[#myVAR#]")
What's the best way to do this in PHP?
I've tried goofy stuff (?) like: $_POST["parf_+$myVAR"] but so far, nothing seems to work for me.
TIA.