ycans Posted September 12, 2012 Share Posted September 12, 2012 Hi, I'm very new to php and I'm trying to create a string within a function, but every time I try to output the "email_address", the text just shows up as "Array". Can you point me to where I'm going wrong? Many thanks function delete_user($_POST, $delete) { if(isset($delete)) { $check = $_POST['check']; $id = $_POST['id']; $email_address = $this->query("SELECT email_address FROM ".DBTBLE." WHERE id = '$id'"); Delete_Account($email_address, $id); }} Quote Link to comment https://forums.phpfreaks.com/topic/268311-query-select-within-a-function/ Share on other sites More sharing options...
Barand Posted September 12, 2012 Share Posted September 12, 2012 $email_address in that code is a query result. From that result you need to fetch a row. The email address you want will be the first column in that row. Quote Link to comment https://forums.phpfreaks.com/topic/268311-query-select-within-a-function/#findComment-1377451 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.