Welcome Guest, Not a member yet? Register   Sign In
Array without keys (index) from DB
#1

Hi!

I need to get emails from my DB and insert this into email method. I need array without keys:

PHP Code:
$emails = array (
       
'[email protected]',
       
'[email protected]',
       
'[email protected]',
       
// etc


How Can I reach this?
Reply
#2

(This post was last modified: 08-01-2015, 09:41 AM by skunkbad.)

PHP Code:
<?php


$query 
$this->db->select('email_address')
    ->from('emails')
    ->get();

if( 
$query->num_rows() > )
{
    foreach$query->result() as $row )
    {
        $emails[] = $row->email_address;
    }

Reply




Theme © iAndrew 2016 - Forum software by © MyBB