Creating an Array of values from DB and passing in

2019-06-11 02:21发布

I want to create an array of Values taken from the DB and pass them into a Form. I have a set of functions that calculate and fetch results:

$uid = $current_user->ID;
$user_email = $current_user->user_email;
$oid = $_GET['oid'];
$order_total = walleto_get_total_for_order($oid); 

All functions have been tested and work well.

  1. How do I create an array of the values?
  2. How to take the values and paste them into a FORM and send ?

------- This is the a request for solution after tests on the question from here - not resolved ----------

1条回答
何必那么认真
2楼-- · 2019-06-11 03:12

Creating an array is quite simple :

$myarray = array() ; 

$myarray['uid'] = $current_user->ID;
$myarray['user_email'] = $current_user->user_email;
$myarray['oid'] = $_GET['oid'];
$myarray['order_total'] = walleto_get_total_for_order($oid);

Then you don't "paste" the values into a form, you set them as values and they will be sent when the user click on the submit button

查看更多
登录 后发表回答