LuisMP Posted August 23, 2016 Share Posted August 23, 2016 (edited) Hello again. I wish to select a row in DB ps_costumer where id_customer =1. I made this code that I think grabs that array. $query = 'SELECT * FROM `ps_customer` WHERE `id_customer`=1'; $array = Db::getInstance()->ExecuteS($query); now, how can I retreive the value of, let´s say, element 31 of the array? $array[31] doesn´t work. What kind of array is this? one dimension, multi dimension, associative? Best Regards Luis Edited August 23, 2016 by LuisMP (see edit history) Link to comment Share on other sites More sharing options...
LuisMP Posted August 23, 2016 Author Share Posted August 23, 2016 Ok I figured ou that the array is: $ps_customer = array( array('id_customer' => '1','id_shop_group' => '1','id_shop' => '1','id_gender' => '1','id_default_group' => '3','id_lang' => '1','id_risk' => '0','company' => '','siret' => '','ape' => '','firstname' => 'John','lastname' => 'DOE','email' => '[email protected]','passwd' => '1b395b80d383f6777f0bf6c46ad5edb3','last_passwd_gen' => '2016-08-18 06:22:10','birthday' => '1970-01-15','newsletter' => '1','ip_registration_newsletter' => '','newsletter_date_add' => '2013-12-13 08:19:15','optin' => '1','website' => '','outstanding_allow_amount' => '0.000000','show_public_prices' => '0','max_payment_days' => '0','secure_key' => '6c7065c58d60dc78fabe4becf6985e57','note' => '','active' => '1','is_guest' => '0','deleted' => '0','date_add' => '2016-08-18 12:22:10','date_upd' => '2016-08-18 12:22:10','ti_nspire' => '0','ti_nspirecas' => '1') ); So a mutlti dimensional associative array? how do I get the value that is for exemple in 'ti_nspire' key? Link to comment Share on other sites More sharing options...
electriz Posted August 23, 2016 Share Posted August 23, 2016 foreach($array as $item) { echo $item['COLUMN_NAME']; } Link to comment Share on other sites More sharing options...
LuisMP Posted August 23, 2016 Author Share Posted August 23, 2016 Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now