• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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 (
       
'email1@domain.com',
       
'email2@domain.com',
       
'email3@domain.com',
       
// etc


How Can I reach this?
Reply

#2
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.