我在会话中有一组成员数据
$session_mem_id = $_SESSION['mem_id'];
$member_data = member_data($session_mem_id, 'mem_id', 'mem_email', 'mem_password', 'mem_address', 'mem_city', 'mem_postcode', 'mem_county', 'mem_country', 'mem_first_name', 'mem_last_name', 'password_recover', 'allow_email', 'admin', 'mem_tel');
如果我
var_dump($member_data);
die();
输出
array(14) { ["mem_id"]=> string(2) "11" ["mem_email"]=> string(26) "j.hfdfd2@gmail.com" ["mem_password"]=> string(8) "password" ["mem_address"]=> string(16) "41 fdrel Drive" ["mem_city"]=> string(9) "Maifdfd" ["mem_postcode"]=> string(8) "df14 4fS" ["mem_county"]=> string(4) "dfdf" ["mem_country"]=> string(14) "United Kingdom" ["mem_first_name"]=> string(4) "Bert" ["mem_last_name"]=> string(12) "dgfdgd" ["password_recover"]=> string(1) "0" ["allow_email"]=> string(1) "1" ["admin"]=> string(1) "1" ["mem_tel"]=> string(11) "07900186785" }
现在我如何将这些信息解析为我的函数,因为我只能解析的是mem_id,order_id和orderdate,其他一切都是空白
function createTransaction(){
// Insert into the transactions table
$query1 = mysql_query("INSERT INTO transactions (mem_id, OrderDate, Ship_Phone, Ship_Address, Ship_City, Ship_County, Ship_PostCode, Ship_Country) VALUES('{$_SESSION['mem_id']}', NOW(), '{$member_data["mem_tel"]}', '{$member_data['mem_address']}', '{$member_data['mem_city']}', '{$member_data['mem_county']}', '{$member_data['mem_postcode']}', '{$member_data['mem_country']}')") or die(mysql_error());
}